git checkout remote branch
In your workflow you'll often need to checkout and fetch branches from a remote repository to do code review of your colleagues for example.
Usage:
git checkout -b <local-branch> <remote-branch>
git fetch
So for example I have a branch called feature/abc remotely
git checkout -b feature/abc origin/feature/abc
There is also a shortcut for this command:
git checkout --track -b <remote-branch>
Related protips:
Written by Esteban
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#