Branch off a remote branch, locally.
A lot of people still checkouts a remote branch locally, then creates a new branch off it to work on. A short command to avoid the extra checkout is;
git fetch origin remote_branch_name:local_branch_name
Example:
git fetch origin feature/add-client-button:hotfix/add-client-button-redirect
I found this helps you keep a cleaner list of local checkouts.
I am unable to find the original link but i stumbled upon this on StachOverflow.
Written by David du Toit
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#