Bringing my git-ignore settings with me
Innsendt: 22.01.12 Arkivert i: code, Uncategorized Leave a comment »Since I’m working a lot of different places, and on quite a few different computers, I need to reconfigure my git-ignore settings every now and then. To manage my settings, I’ve put my git excludes in my Dropbox folder. This gives med the added advantage that all ignore settings are automatically syncronized between computers.
This is the file I have in Dropbox:
bin/ obj/ *.user *.suo _ReSharper.*/
And this is how git status looks like if I don’t use the ingore file:
Git notifies me that the Visual Studio build output and local settings are in the repository but are untracked. As my solutions grow, this list can grow to be very big.
I run this statement in git bash, pointing to my dropbox folder on my D: drive. This should work from Windows Command Line too, but then you need to use the Windows path
git config --global core.excludesfile /d/Dropbox/git/excludes
Note that it’s important to use the –global flag to make it valid for all local repositories, as this makes the command store the setting in the .gitconfig in your HOME folder.
When I now run git status, all the local files and settings from Visual Studio is now ignored:

