Git: Make Existing Branch Track Remote Branch

It may happen that you create a local branch and forget to make it track a remote branch. We can make up for this by using the –set-upstream-to option of the git branch command. Say we are currently on branch issue123 and we want to make this branch track origin‘s issue123 branch.

For Git versions >=1.8

For Git versions <= 1.7

Mind the switched order of arguments. This command will also work in later Git versions:

 Links

Leave a Reply