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.
Here is a little gotcha that I have encountered before. When creating public\private keys for use with Git and TortoiseGit, I seem to have no problem using PuttyGen. (How To Link)
However, when I use SSH-KeyGen, I seem to encounter the following error while connecting to Git.
Couldn’t load this key (OpenSSH SSH-2 private key)
So here is the deal. My install of TortoiseGit uses Pageant to store private key for use. This program only really recognizes private keys in the .ppk format, which is the Putty format.
So what you can do with the KeyGen private key is, convert it to .ppk using PuttyGen. Its pretty easy to do, just click the Load button from PuttyGen, select your file, enter your phrase, and then save the file (.ppk) back to disk. Now update Tortoise (remote) to use this new .ppk file.