Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (29.3k points)

What is the difference between these two commands?

git pull

and

git pull origin master

1 Answer

+1 vote
by (50.2k points)

The differences between git pull and git pull origin are:

git pull= git fetch origin + git merge origin/master (or whatever your upstream is)

git pull origin = git pull (as long as the origin is your upstream remote)

You can configure an upstream for a local branch. After a new clone, you will have a local branch "master", a remote "origin" and your master branch has "origin/master" as upstream. Your upstream configuration can be seen with git branch -vv or by looking at .git/config.

Related questions

Browse Categories

...