Last Updated: February 25, 2016
·
238
· dhdutoit

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.