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
Written by Rob Waring
Related protips
1 Response
Technically: "git checkout branchname" do the same thing with the default configuration
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#