Skip to content

Instantly share code, notes, and snippets.

@dwayne
Created December 19, 2012 12:28
Show Gist options
  • Save dwayne/4336350 to your computer and use it in GitHub Desktop.
Save dwayne/4336350 to your computer and use it in GitHub Desktop.
Git and TFS Integration on Ubuntu 12.04 LTS

Git and TFS Integration

http://gittf.codeplex.com/

http://www.microsoft.com/en-us/download/details.aspx?id=30474

Resources

Setting up on Ubuntu 12.04

How to create and checkin a new Git repo into TFS?

$ mkdir example-git-tf-project && cd example-git-tf-project
$ ... do some stuff ...
$ git init && git add . && git commit -m "Initial commit"

# The following step only needs to be done once:
$ git tf configure https://caribbeanideas.visualstudio.com $/example-git-tf-project

$ git tf checkin

How to access an existing TFS project?

$ git tf clone https://caribbeanideas.visualstudio.com $/existing-tfs-project

Tips

  1. If you don't want to be prompted for credentials every time you run git-tf, you can store your credentials in your Git configuration.

     $ git config --global git-tf.server.username your-username
     $ git config --global git-tf.server.password your-password
    

Workflow

# Make sure you're working with your team's latest code by pulling from TFS
$ git tf pull

$ git checkout -b topic-branch dev
$ ... do some work locally in your git repo and test ...
$ git add .
$ git commit -m "Describe your commit"

# Merge your changes into the local development branch and maybe do some more testing
$ go dev && git merge topic-branch

# Merge your changes into the master branch
$ go master && git merge dev

# Update TFS
$ git tf checkin

# or
# Maybe you're working on a task or fixing a bug that's tracked as a work item. Then indicate
# that when you check in. TFS will resolve the bug or close the task, and it'll link the
# changeset to the work item. That will trace through to things like build reports
$ git tf checkin --resolve=xxxxx

Help

$ git tf help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment