tzi
tzi

Reputation: 9459

How to do a `git pull` in several steps

I think that a git pull command is an alias for a git fetch and a git merge.

I would like to do a git pull origin master in several steps. It think it could be something like this:

git fetch origin master
git merge <remote fetched branch>

Upvotes: 0

Views: 1133

Answers (2)

tzi
tzi

Reputation: 9459

A git fetch update the remote-tracking branches under refs/remotes/<remote>/. So the commands should be:

git fetch origin master
git merge refs/remotes/origin/master

Thanks to this answer about the difference between git pull a git fetch.

Upvotes: 1

isherwood
isherwood

Reputation: 61053

It would be just simply

git fetch origin master
git merge origin/master

The first command fetches master from origin. The second merges the remote into your topic branch.

Upvotes: 2

Related Questions