Last Updated: February 25, 2016
·
678
· rjwaring

Git tracking checkouts

Having difficulty getting git to track the origin when you create new branches? Think the whole

git checkout -b 'branchname' origin/branchname

feels like a hack?

Turns out it is and theres a proper command for it.

git checkout -t branchname

will automatically track the remote branch if it's in your local origin list. If it's not do a

git fetch

beforehand. Thanks to http://gitready.com/intermediate/2009/01/09/checkout-remote-tracked-branch.html

1 Response
Add your response

Technically: "git checkout branchname" do the same thing with the default configuration

over 1 year ago ·