How to locally ignore .git and .gitignore in a svn repo?

前端 未结 1 767
庸人自扰
庸人自扰 2021-02-19 11:26

I have a SVN working copy (managed by TortoiseSVN). In that working copy I use git for local version control and branching. Of course, I want to hide the .git directory and .gi

相关标签:
1条回答
  • 2021-02-19 12:17

    Use the global-ignores configuration option. Which is documented in the SVN Book's Ignoring Unversioned Items section.

    This setting will impact all of your Subversion clients and working copies, but I suspect that ignoring .git and .gitignore on all checkouts is not an issue for you.

    Direct editing of the config file

    On Unix that setting would be applied to ~/.subversion/config and on Windows it'd be %APPDATA%\Subversion\config (though it can also be stored in the registry, see the documentation in the SVN Book about that).

    The default will be commented out like so:

    ### Set global-ignores to a set of whitespace-delimited globs
    ### which Subversion will ignore in its 'status' output, and
    ### while importing or adding files and directories.
    ### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'.
    # global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo
    #   *.rej *~ #*# .#* .*.swp .DS_Store
    

    You just need to uncomment the lines and add .git and .gitignore to them.

    TortoiseSVN UI

    In your case you're using TortoiseSVN so you can avoid editing the file directly and use the settings within TortoiseSVN. Under the General section there is a Subversion block with an edit block labeled Global ignore pattern. Just add .git and .gitignore to the list of patterns. This is covered in the Global ignores block on the Ignoring files and directories section and more specifically in the details on the Global ignore pattern setting in the Settings section of the TortoiseSVN documentation.

    0 讨论(0)
提交回复
热议问题