I know how to make a new branch that tracks remote branches, but how do I make an existing branch track a remote branch?
I know I can just edit the
or simply by :
switch to the branch if you are not in it already:
[za]$ git checkout branch_name
run
[za]$ git branch --set-upstream origin branch_name
Branch origin set up to track local branch brnach_name by rebasing.
and you ready to :
[za]$ git push origin branch_name
You can alawys take a look at the config file to see what is tracking what by running:
[za]$ git config -e
It's also nice to know this, it shows which branches are tracked and which ones are not. :
[za]$ git remote show origin