When using the Git-TF tools, there are a few recommended settings that should make it easier to work with other developers that are using TFS.

Line Endings

core.autocrlf = false

Git has a feature to allow line endings to be normalized for a repository, and it provides options for how those line endings should be set when files are checked out. TFS does not have any feature to normalize line endings - it stores exactly what is checked in by the user. When using Git-TF, choosing to normalize line endings to Unix-style line endings (LF) will likely result in TFS users (especially those using VS) changing the line endings back to Windows-style line endings (CRLF). As a result, it is recommended to set the core.autocrlf option to false, which will keep line endings unchanged in the Git repo.

Ignore case

core.ignorecase = true

TFS does not allow multiple files that differ only in case to exist in the same folder at the same time. Git users working on non-Windows machines could commit files to their repo that differ only in case, and attempting to check in those changes to TFS will result in an error. To avoid these types of errors, the core.ignorecase option should be set to true.

.gitignore

Having a .gitignore file for your project helps make sure that only the files you care about are versioned, and not the files that are just temporary or for your local machine only.  Take a look at the gitignore project on GitHub for sample .gitignore files for various application types including C# and VB.NET

Last edited Jan 8, 2013 at 12:49 PM by martin, version 1

Comments

stuartjsmith Mar 13 at 5:33 PM 
It would make it a bit clearer if you were to change the gray boxes above to be the actual commands that you should run i.e.

git config --global core.autocrlf false
git config --global core.ignorecase true