How do I check out a remote Git branch?


$ git fetch origin
$ git checkout branch_name

As you can see, running git fetch origin retrieved any remote branches we were not yet setup to track on our local machine. From there, since we now have a ref to the remote branch, we can simply run git checkout remote_branch and we'll gain the benefits of remote tracking.

Comments

Leave a Reply