Reputation: 29658
I'm trying to exclude subversion's folders from being tracked by git. I tried a couple different setups for .git/info/exclude, but it doesn't seem to work. I would use git-svn, but it's a pain to request access to get that to work, so I'd rather just work around this by excluding the folders.
I want to exclude ".svn/entries"
I've tried adding the following lines to .git/info/exlude: .svn entries .svn/entries entries svn
No matter what I try, .svn entries shows up when I run git status
Upvotes: 69
Views: 41761
Reputation: 117176
Put ".svn" in a ~/.gitexcludes
file. Then tell git about it:
echo '.svn' > ~/.gitexcludes
git config --global core.excludesfile "/home/USER_NAME/.gitexcludes"
(Make sure you change USER_NAME so it points to your home directory)
Upvotes: 25
Reputation: 31
if you want to keep the svn directory.
you may run the following first:
for dir in $(find ./ -type d -name \*.svn); do git rm --cached -r $dir; done;
and then run echo ".svn" >>.gitignore
in the root directory
Upvotes: 3
Reputation: 401
This thread has the correct answer:
Git - Ignore certain files contained in specific folders
What you really need is:
.svn*
Upvotes: 30
Reputation: 117
This following structure and .gitignore contents worked for me
.svn/
.gitignore
Upvotes: 5
Reputation: 2417
since every versioned folder has a .svn directory you have to put:
*/.svn/*
Upvotes: 2
Reputation: 14529
Do what Casey
suggests, except name the file .gitignore
and put it in the root of your git repo.
I also like to do a attrib +h .gitignore
so it won't show up in my explorer windows.
Upvotes: 3
Reputation: 57188
I think you want to use a .gitignore file in your top-level directory. This will work if you put ".svn/entries" on a line in that file. You might just put ".svn" instead of ".svn/entries" as well.
EDIT: See comments. If they files are already being tracked by git, they'll always show up in git status
.
Upvotes: 50