Git Tracking Remote Branches

For some reason, I’ve always failed to¬†remember what the command to track a remote branch is in git. I look it up on this page everytime I want to do it:¬†

Well no more. I figured if I write a post about it, I will remember it so here we go:

git fetch origin
git checkout -b somename origin/somename

That’s it… the branch will be set up to track the remote and you are switched over automatically.

Leave a Reply

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