pull --rebase: be cleverer with rebased upstream branches

When the upstream branch is tracked, we can detect if that branch
was rebased since it was last fetched.  Teach git to use that
information to rebase from the old remote head onto the new remote head.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Johannes Schindelin
2008-01-26 18:04:37 +00:00
committed by Junio C Hamano
parent e509db990b
commit c85c79279d
3 changed files with 33 additions and 2 deletions

View File

@ -35,7 +35,11 @@ include::urls-remotes.txt[]
include::merge-strategies.txt[]
\--rebase::
Instead of a merge, perform a rebase after fetching.
Instead of a merge, perform a rebase after fetching. If
there is a remote ref for the upstream branch, and this branch
was rebased since last fetched, the rebase uses that information
to avoid rebasing non-local changes.
*NOTE:* This is a potentially _dangerous_ mode of operation.
It rewrites history, which does not bode well when you
published that history already. Do *not* use this option