- Download Git-Tfs from https://github.com/git-tfs/git-tfs/releases and extract the zip to c:\GitTfs
- Add ;c:\GitTfs to your path. Now you have a git-tfs bridge!
To clone the main branch of your TFS project as a git repo (aka get the codez):
- Create a new directory to store your git projects, seperate from your 'standard' TFS source directory**. (For example, use c:\projects.git instead of c:\projects)
- Open a command prompt and navigate to your git source directory.
- mkdir MyAwesomeProject, cd MyAwesomeProject
- git tfs clone http://tfsserver:8080/tfs/projects%20collection "$/My Awesome Project/Branch" . --with-branches
Welcome to git!
- if your project collection name contains spaces, MAKE SURE YOU ESCAPE IT (as above)! This same caveat does not apply to the branch name.
- you need to make sure the thing you're trying to clone IS A BRANCH, and not just a folder. To turn a folder into a branch in TFS, locate it in Source Control Explorer, right click it, Branching and Merging > Convert to Branch. Done.
- ** If git-tfs encounters any conflicts with existing TFS workspace mappings, it will get upset.