Saturday, June 18, 2016

Checking out a remote branch (that does not exist locally) in Git

$ git branch -a -v
* master                           f81a844 ~ ensures bin/factorrs works on Windows
  remotes/origin/HEAD              -> origin/master
  remotes/origin/coalescing-common ad0cc13 bin/find_unused_header_files : + uses libCLImate and provides standard and custom flags
  remotes/origin/master            f81a844 ~ ensures bin/factorrs works on Windows


$ git checkout -b coalescing-common origin/coalescing-common
Branch coalescing-common set up to track remote branch coalescing-common from origin.
Switched to a new branch 'coalescing-common'


git branch -a -v
* coalescing-common                ad0cc13 bin/find_unused_header_files : + uses libCLImate and provides standard and custom flags
  master                           f81a844 ~ ensures bin/factorrs works on Windows
  remotes/origin/HEAD              -> origin/master
  remotes/origin/coalescing-common ad0cc13 bin/find_unused_header_files : + uses libCLImate and provides standard and custom flags
  remotes/origin/master            f81a844 ~ ensures bin/factorrs works on Windows