In light of my last post where I mentioned how pleased I am with distributed version control, I thought I should share a few tips that have made my life using Git a bit easier. This post will be the first of several posts on configuring Git for daily use by a .NET developer running Windows.
One of the first things to do after creating a new Git repository is to exclude certain files from ever entering the repository. Git has several built-in methods for excluding files. I use a single .gitignore file at the root of my source code directory. It’s simple, but it works. Surely, you, Reader, will eventually need to add some project specific lines to the following basic template, but this has been working for me:
*resharper.user
# Visual Studio
[Dd]ebug/
[Rr]elease/
*.sln.cache
*.suo
*.csproj.user
# Resharper
*[Rr]e[Ss]harper.user
_ReSharper.*/
The *resharper.user files store user specific settings for a solution, so they should not be checked into the repository. Similarly, the other lines prevent build output, VS user specific solution configuration and ReSharper temporary data from ever being considered for check-ins. This is especially useful because excluded files are not listed when checking for modifications.
April 6th, 2010: added a few extra lines to ignore file.
April 16th, 2010: Resharper 5.0 uses different casing for the resharper user file.