Regarding git fetch -p
, its behavior changed in Git 1.9, and only Git 2.9.x/2.10 reflects that.
See commit 9e70233 (13 Jun 2016) by Jeff King (peff
).
(Merged by Junio C Hamano -- gitster
-- in commit 1c22105, 06 Jul 2016)
fetch
: document that pruning happens before fetchingThis was changed in 10a6cc8 (
fetch --prune
: Run prune before fetching, 2014-01-02), but it seems that nobody in that discussion realized we were advertising the "after" explicitly.
So the documentation now states:
Before fetching, remove any remote-tracking references that no longer exist on the remote
That is because:
When we have a remote-tracking branch named "
frotz/nitfol
" from a previous fetch, and the upstream now has a branch named "frotz
", fetch would fail to remove "frotz/nitfol
" with a "git fetch --prune
" from the upstream. git would inform the user to use "git remote prune
" to fix the problem.Change the way "
fetch --prune
" works by moving the pruning operation before the fetching operation. This way, instead of warning the user of a conflict, it automatically fixes it.