Git checkout track from remote branch


Let’s say somebody already push their branch in remote called “finances”. We want to fetch and working on this branch from our local. So, the solution :

1
2
3
4
5
git fetch –all

Fetching origin
From github.com:polatic/vasham-erp
 * [new branch]      finance    -> origin/finance

Then, we checkout with tracking

1
2
3
git checkout -t origin/finance
Branch finance set up to track remote branch finance from origin.
Switched to a new branch ‘finance’

Now ready for working :

1
git checkout finance

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.