12 February 2016

How to: Use Git on a TFVC project

Using Git With TFVC

If is possible to use a local git repo with TFVC using Git-TF.
NB: All operations are done in the command line (cmd.exe)


  1. Java runtime Environment: http://java.com/en/download/manual.jsp
  2. Add Java to PATH Environment variable e.g.C:\Program Files (x86)\Java\jre1.8.0_73\bin
  3. Install [gittf.codeplex.com](http://gittf.codeplex.com/) to C:\git-tf

Clone a Branch

  1. Make a parent directory for your repo and cd into it e.g.C:\Dev\Git\MyCompany.MyProject\Development
  2. Clone a branch e.g.git-tf clone https://tfs.mycompany.com/tfs/DefaultCollection $/MyProject/Development/MyBranch

Checkin changes to your local repo

Check in to your local git repo as you would normally with a comment.
This can be done in VStudio, on the command line or using a third party tool e.g.

  • git commit -m "I did some stuff"
  • SourceTree: https://www.atlassian.com/software/sourcetree/overview/
  • TortoiseGit: https://tortoisegit.org/

Forward Integrate TFVC branch > local git repo

  1. cd to the directory e.g.cd C:\Dev\Git\PerfectChannel.AgriClear\Main
  2. Rebase:git-tf pull --rebase

Checkin your changes to TFVC

git-tf pull --rebase & git-tf checkin --associate=[workitem id]

More Information

Atlassian Git Tutorial: https://www.atlassian.com/git/tutorials/setting-up-a-repository

No comments:

Post a Comment