tags:

views:

1923

answers:

4

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

A: 

what do you mean its a pain to request access to get git-svn to work. git-svn just issues svn commands so if you already have SVN access you can use git-svn without anyone upstream knowing at all or needing to change anything

cpjolicoeur
Access to install things on my work computer. There's a perl module missing, and to ask the admins to make that mod, is just a pain...
+8  A: 

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.

Jesse Rusak
I tried this too, and this didn't work. The problem is that each folder has its own .svn/entries.
This works for me, even in the presence of one in each folder. Are the entries showing up in `svn status` because you've already asked git to track them? If you've `git add`ed them, they'll show up no matter what. Just `git rm --cached` them and you'll be OK.
Jesse Rusak
There it is. I started by adding all the files in trunk... Good catch Jesse!
ther is scrip to remove .svn folder check this link.. http://cocoabugs.blogspot.com/2010/09/script-to-remove-hidden-svn-folder.html
jeeva
+3  A: 

Create a ~/.gitexcludes file and put this in:

.svn

Tell git about your .gitexcludes file:

git config --global core.excludesfile "/home/USER_NAME/.gitexcludes"
Casey
Where by .*.swp you mean .svn
kch
Casey, I really thought that was going to work...but alas it didn't. This is pretty frustrating.
@kch fixed that
Casey
Ya, I trid it with .svn , still didn't work.
@johannix - I updated the command. please try again
Casey
+3  A: 

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.

Andrew Burns
Bah- Jesse beat me to it.
Andrew Burns