What is the difference between "git push" and "git push origin master"?

After "git commit", I have two options: 1. "git push", 2. "git push start master". My intention is to push my changes in my local repo to the master github branch. In what circumstances do they matter?

(Also, what does "origin" mean here?)

+3


source to share


1 answer


git push

assumes that you already have a remote repository defined for that branch. In this case, the remote origin

default is used.

git push origin master

indicates that you are pressing a specific remote, in this case origin

.



This will matter if you've created multiple remote repositories in your codebase. If you are running only one remote repository (in this case, just your GitHub repository), then there is no difference between the two.

+7


source







All Articles