Git ignore

From genomewiki
Revision as of 20:55, 16 June 2010 by Galt (talk | contribs)
Jump to navigationJump to search

We had 11 .cvsignore files in the kent repo already that I was able to simply rename to .gitignore because they used a syntax so simple and basic that it was common to git and cvs.

I recently checked in a .gitignore at the highest level, i.e.

 kent/.gitignore

This one excludes *.o, *.a. These were not in CVS because cvs ignores them automatically.

Recently I added the .gitignore file itself.

.gitignore files apply to their directory and all directories below.

As handy as they are, we do not want to to too crazy with elaborate .gitignore files everywhere.

There are 2 places where you can add your own custom ignores that will not affect other people.

1. ~/kent/.git/info/exclude

$ cat .git/info/exclude

   # ignore objects and archives, anywhere in the tree.
   *.[oa]

This is just an example. This will act globally to your kent repo only, not affecting other users.

2. ~/.gitconfig Put your excludes into a ~/.gitignore and tell git about it with

 [core]
   excludesfile=~/.gitignore

in the [core] section of your ~/.gitconfig.

This will act globally to your all your repos, but does not affect other users.

http://www.kernel.org/pub/software/scm/git/docs/gitignore.html

-Galt