Re: How to rebase after upstream was merged?
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Jul 4, 2007, 13:30 UTC
- Message-ID
- <Pine.LNX.4.64.0707041426570.4071@racer.site>
- In-Reply-To
- <468B918E.FBCADCB9@eudaptics.com>
Hi,
On Wed, 4 Jul 2007, Johannes Sixt wrote:
Show 11 quoted lines
> I have this history: > > o--o--o--o--o <- origin > \ \ > x--x--x--M--x--x <- master (HEAD) > > At this point I would like to rebase to straighten the history, but it > won't let me: > > $ git rebase origin > Current branch master is up to date.
I'd do something like
$ git checkout -b tmp HEAD~3 $ git rebase origin $ git checkout master $ git rebase --onto tmp HEAD~2 $ git branch -d tmp
Show 7 quoted lines
> I would like to extend the check to also check for linear history. How > can I do this most efficiently? My first try is along these lines: > > test $(git rev-list origin..HEAD | wc -l) = \ > $(git rev-list --no-merges origin..HEAD | wc -l) > > Is there a better approach?
I usually to
test -z "$(git rev-list --parents origin..HEAD | grep " .* ")"
Hth, Dscho