The book seems to indicate that those commands yield the same effect:
The simple case is the example you just saw, running git checkout -b [branch] [remotename]/[branch]. If you have Git version 1.6.2 or later, you can also use the --track shorthand:
$ git checkout --track origin/serverfix
Branch serverfix set up to track remote branch serverfix from origin.
Switched to a new branch 'serverfix'
To set up a local branch with a different name than the remote branch, you can easily use the first version with a different local branch name:
$ git checkout -b sf origin/serverfix
That's particularly handy when your bash or oh-my-zsh git completions are able to pull the origin/serverfix
name for you - just append --track
(or -t
) and you are on your way.