Excluding files in git and egit on eclipse


This is not rocket science but more a reminder for myself 🙂

When working with eclipse and the egit plugin I noticed that a ‘git refresh’ would take minutes in certain projects. The particular project has a few directories containing 10000+ .ogg and .png files which are not included in the git repo. I have git exclude files and global .gitignore files in place but egit seems to ignore them.
So I added the file patterns to the egit ‘Ignored Recources’.

(For example I want to exclude everything in my */lib/Sounds)
Open Window -> Preferences -> Team -> EGit -> Add pattern
The pattern to add: */lib/Sounds/* (duhhh)
Push ‘apply’ and presto, the refresh just takes seconds 🙂

Just for completeness I include my .gitignore_global, the relevant parts and the projects exclude file.
To have the git global ignoring stuff do: git config --global core.excludesfile ~/.gitignore_global

# Custom stuff

The .git/info/exclude file:
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~

Prevent “git gui” on windows from repeatedly asking for a ssh passphrase


If you are using remote git repository with ssh on widows and you use the program “git gui/bash” you may get tired of constantly entering your ssh passphrase every time you do a push or pull.
To prevent this you must fix it the Linux way, what else 🙂
Add to you home dir, or what ever it is called on windows, a .bashrc file. (mind the dot in front of the name.
With the following contents:

eval `ssh-agent`

That’s it, now you are only asked for your passphrase once at when you start “git bash”

Go to Top