Recently I have been on a few projects with developers that were not as experienced in using Visual Studio with Microsoft’s Team Foundation Server so I thought it was prudent to put together some best practices to help them over some minor learning curves and also as a refresher for those of us that have been using it for years.
What should be checked in?
This may seem obvious but there are some things that you may not think of checking in that you should:
your *.sln and *.csproj (and others) contain the list of every file that is in your solution/project. If you just check in a folder of files on your screen it may look fine but when someone else goes to get your code they won’t see these files.
If you are not familiar with NuGet packages yet it’s well worth your time to look it up. This was more of an issue with previous versions of Visual Studio but since they are not visible in the solution explorer and contain binary files (*.dlls) inexperienced developers may ignore them not realizing that these should be checked in
Most projects that I deal with have some sort of scripts associated with them. Things like scripting the setup of a new local environment (for new developers or getting a clean slate for existing ones) or deployment scripts (for upgrading an existing database schema to work with the latest version of your code).
- Batch Files
Even though I like to keep documentation in a CMS like SharePoint it’s also very helpful to check it in with the rest of your code. I most often do this when merging code into another branch because it’s nice to keep the doc that goes with a particular version tied to it in source control.
- Deployment Instructions
- Technical Specifications
There are plenty of other things to make sure you have checked in but these are the big ones that I often see missed by old and new developers alike.
Look for the next part in this series “The Right Way to Check In”