Git Command Helper for TFS Users

The majority of the projects I have worked on in the past have used either TFS (TFVC) or Git.  For the projects that have used Git, I’ve noticed that for the people unfamiliar with Git, there can be some hesitation because of the unknowns.

So in this blog post I will simply try to align the standard TFS commands with the corresponding Git commands.  Hopefully this will help out any beginner Git users who are already familiar with TFS.

  • TFS (Get Latest) – Git (Clone and Pull)
    • Git Clone makes a Git repository copy from a remote source.
    • Pull gets files from the remote repo and merges them to the local repo.
  • TFS (Add) – Git (Add)
    • Remember, with Git you are working with a local repository, so the “git add” command will add the file(s) to your local repo for tracking purposes.
  • TFS (Check-in) – Git (Commit) (Push)
    • The “git commit” command will commit your changes to your local repo.
    • The “git push” command will push the changes to the remote repo.
  • TFS (Check-out)  – Git (-)
    • Kind of like how you can setup TFS to auto check-out a file, Git automatically recognizes changes to tracks files
  • TFS (Branch) – Git (Branch)
    • The “git branch” command will create a branch as needed.
  • TFS (Label) – Git (Tag)
    • The “git tag” command will tag\label a Commit.
  • TFS (Shelve) – Git (Stash)
    • The “git stash” command will store\save\stash\shelve your changes.  Somewhat similar to the TFS shelve-set feature
  • TFS (Merge) – Git (Merge)
    • The “git merge” command merges changes from 1 branch to another similar to TFS and push to local repo.

I am by no means a Git expert, but hopefully this blog will help out any TFS guru’s uneasy about working with Git.

github-octocat