I have seen different ways to checkout existing remote branch:
Suppose my friend has pushed new branch \'bigbug\' and I want to check out and switched my local working c
The base for the checkout command is:
git checkout --[options] /
When you perform a git checkout -b bigbug origin/bigbug
you are saying to Git to execute two commands:
When you perform git checkout -t origin/bigbug
you are saying to Git to execute the same two commands above. The difference is that it will name the local branch with the same name of the remote branch (in the first example you can change the name of the remote branch to whichever you want). The -t options is the same of --track.
In your last command, when you run: git fetch
you tell Git to lookup on the remote repositories for new commits, branches, etc. Then when you run git checkout bigbug
you tell it to change the workspace to match the bigbug branch. If you have a local branch with that name, Git will checkout it. If not, it will look the remote branches to one matching name and then create a local branch with the same name.
So, when you use one or another it depends of what you want. Most of the time they will work as the same (except in the last example, when you already have a local branch with the same name of a remote branch). The most importante thing is to know exactly what the command and options do and combine them accordingly to what you want.