Skip to main content
Chapter 31 of 61 · 5 sections · Page 132

Git: git-tfs

Bridge Git and Team Foundation Server (TFVS) with clone, checkin, pull, and push workflows.

Original chapter reference: Chapter 31: git-tfs. The command options and documentation recipes below are fully transcribed from Git Notes for Professionals.

Section 31.1: git-tfs clone

This will create a folder with the same name as the project, i.e. /My.Project.Name

Source example · PDF page 132
$ git tfs clone http://tfs:8080/tfs/DefaultCollection/ $/My.Project.Name

Section 31.2: git-tfs clone from bare git repository

Cloning from a git repository is ten times faster than cloning directly from TFVS and works well in a team environment. At least one team member will have to create the bare git repository by doing the regular git-tfs clone first. Then the new repository can be bootstrapped to work with TFVS.

Source example · PDF page 132
$ git clone x:/fileshare/git/My.Project.Name.git
$ cd My.Project.Name
$ git tfs bootstrap
$ git tfs pull

Section 31.3: git-tfs install via Chocolatey

The following assumes you will use kdiff3 for file diffing and although not essential it is a good idea.

Source example · PDF page 132
C:\> choco install kdiff3

Git can be installed first so you can state any parameters you wish. Here all the Unix tools are also installed and 'NoAutoCrlf' means checkout as is, commit as is.

Source example · PDF page 132
C:\> choco install git -params '"/GitAndUnixToolsOnPath /NoAutoCrlf"'

This is all you really need to be able to install git-tfs via chocolatey.

Source example · PDF page 132
C:\> choco install git-tfs

Section 31.4: git-tfs Check In

Launch the Check In dialog for TFVS.

Source example · PDF page 132
$ git tfs checkintool

This will take all of your local commits and create a single check-in.

Section 31.5: git-tfs push

Push all local commits to the TFVS remote.

Source example · PDF page 132
$ git tfs rcheckin

Note: this will fail if Check-in Notes are required. These can be bypassed by adding git-tfs-force: rcheckin to the commit message.

Buy me a coffee
Daily Practice
0/0