6

I want to know that if I only use git command :

git push

and if I use

git push origin master

then, what is the difference between them?

I am working on gitlab and i have developer access to the project I am working on. I am using windows command line.

torek
  • 448,244
  • 59
  • 642
  • 775
mistletoe
  • 463
  • 4
  • 11
  • 29
  • Possible duplicate of [git push vs git push origin ](http://stackoverflow.com/questions/19312622/git-push-vs-git-push-origin-branchname) – vatz88 Apr 24 '17 at 16:17
  • Possible duplicate of [What is the difference between git push origin and git push origin master](https://stackoverflow.com/questions/12462481/what-is-the-difference-between-git-push-origin-and-git-push-origin-master) – tidy May 17 '19 at 08:36

1 Answers1

2

git push: works like git push "remote", where "remote" is the current branch’s remote (or origin, if no remote is configured for the current branch).

and

git push origin master: Find a ref that matches master in the source repository (most likely, it would find refs/heads/master), and update the same ref (e.g. refs/heads/master) in origin repository with it. If master did not exist remotely, it would be created.

Please refer this for more information: link

รยקคгรђשค
  • 1,919
  • 1
  • 10
  • 18