4

Most of the time I use git push origin master to update my code.

When I set up a new repo today github suggests using git push -u origin master. Had read the manpage but still no idea. What is the difference between these two commands?

Deqing
  • 14,098
  • 15
  • 84
  • 131
  • 4
    `-u` is short for `--set-upstream`, which just lets you use commands like `git push` and `git pull` without specifying which remote to push/pull from. Since you've almost certainly set your upstream branches already, you won't see any difference. – Chris Hayes May 16 '14 at 03:04
  • 2
    It's a fair question, though. As so often, the docs are pretty opaque. I can certainly see how "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" might not communicate much to one's mind. – matt May 16 '14 at 03:05

0 Answers0