Set upstream master in Git

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream master origin/<branch>

Where could be master.

An example would be:

git branch --set-upstream master origin/master

With this, you can just do a git pull and git push without having the branch specified.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>