bmcentee148
bmcentee148

Reputation: 604

Git pull without arguments?

git pull origin foo

It will fetch and merge ONLY branch foo. But what happens when you run

git pull

without any arguments?

Upvotes: 6

Views: 1688

Answers (3)

kiewic
kiewic

Reputation: 16420

In my experience git pull also includes a git remote update origin

Upvotes: 0

Jarek Piórkowski
Jarek Piórkowski

Reputation: 648

git pull without any arguments defaults to currently checked out branch and the remote repository it is set to track.

The manual page for git pull isn't super user friendly but:

Incorporates changes from a remote repository into the current branch.

Default values for <repository> and <branch> are read from the "remote" and "merge" configuration for the current branch as set by git branch --track.

Upvotes: 6

Jay
Jay

Reputation: 2686

git pull actually is a git fetch then calls git merge to merge the retrieved branch heads into the current branch.

Here is the syntax for the pull:

'git pull' [options] [<repository> [<refspec>...]]

everything in the [] are optional so it should attempt to merge all branches

Upvotes: 1

Related Questions