Question
What's the difference between:
$ git remote add origin git@github.com:yourname/yourproject.git
$ git config remote.origin.push refs/heads/master:refs/heads/master
$ git push
and:
$ git remote add origin git@github.com:yourname/yourproject.git
$ git push origin master -u
Is the second version simply newer and shorter than the first version, or are there other differences?
Background Research
As of Git 1.7.0, you can use the --set-upstream
option with git push
. According to the git push
manual:
-u, --set-upstream For every branch that is up to date or successfully pushed, add upstream (tracking) reference, used by argument-less git-pull(1) and other commands. For more information, see branch.<name>.merge in git-config(1).