Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How git-pull corporate with git-fetch (was: what does git-pull option `-p` mean)?

Sometimes I see at articles command: git pull -p
But I do not found info about that in official documentation

What does that option mean?

UPD

As noted by @torek the -p option is passed to git fetch. And -p here means:

-p
--prune
Before fetching, remove any remote-tracking references that no longer exist on the remote.

But I do not understand how git-pull corporate cooperate with git-fetch?
How I can figure out how and which git options fall through one command to another?

like image 947
Eugen Konkov Avatar asked Oct 13 '16 18:10

Eugen Konkov


Video Answer


1 Answers

A git pull command is a shorthand command that gets interpreted as a "git fetch" plus a "git merge FETCH_HEAD" command. If you give a -p flag to a pull, it is actually the --prune command that gets run with the "git fetch" part of the command. This removes (prunes) all remote-tracking branches in your local repository that no longer exist on origin.

like image 95
JGTaylor Avatar answered Oct 22 '22 02:10

JGTaylor