-1

what is the difference between these commands:

git push -u origin master

git push origin master
Savin
  • 47
  • 11

1 Answers1

3

In short, the -u parameter tells git to set upstream source for this branch. After this is done, no need to set it again, git push origin master is sufficent.

Romain Valeri
  • 19,645
  • 3
  • 36
  • 61
  • what do u mean upstream source ? – Savin Oct 04 '18 at 03:45
  • From [git doc](https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches) : « Checking out a local branch from a remote-tracking branch automatically creates what is called a “tracking branch” (and the branch it tracks is called an “upstream branch”) » – Romain Valeri Oct 04 '18 at 06:46