2012-03-27 9 views
7

Mein Git Repository hat ~ 2.000 Commits. Für pädagogische Zwecke habe ich mit git rebase -i gespielt.Idempotente Git-Rebase versagt mit falschen Konflikten?

Wenn ich tippe git rebase -i first-commit (wo first-commit ein Tag für die erste ist auf dem Repo begehen) und nichts ändern (das heißt alle pick <hash> unberührt lassen), beginnt git meine Geschichte des Abspielens aber nicht auf Dutzende von Commits unter Berufung auf Konflikte. Was würde das verursachen? Warum wiederholt es nicht einfach meine gesamte Geschichte?

Antwort

6

Ich habe versucht, es mit einem Open-Source-Projekt neu zu erstellen, und bekam ähnliche Ergebnisse, Konflikte gemeldet, wenn Rebasing auf den ersten Commit mit Rebase interaktiv.

Ich lief es ein zweites Mal und bemerkte, dass es bei dem gleichen Commit geschah.

git clone git://git.lttng.org/lttng-tools.git 
git tag first-commit fac6795 
git rebase -i first-commit 

Could not apply e4baff1... listing and activation of loglevel by number 
git rebase --abort 

Es scheint der Konflikt nahe an einem Sammelpunkt vorging:

* 843f5df (HEAD, tag: new-tag) API change for lttng_destroy_session prototype 
* 90192ee Merge branch 'master' 
|\ 
| * 4dbd54a update loglevel printout 
| * e4baff1 listing and activation of loglevel by number 
* | 76d45b4 Add support for UST enable all tracepoints 
* | 6181537 Cleanup lttng enable event command 
|/ 
* 13dce3b loglevels: allow enable/disable 
* 81afa34 Add loglevel to event list 
* 57ab763 ABIs now support 256 char event names 

die Fütterungsmaterial erneut mit der Option -p läuft allerdings war erfolgreich:

-p, --preserve-merges 
      Instead of ignoring merges, try to recreate them. 

      This uses the --interactive machinery internally, but combining it with the --interactive option explicitly is generally not a 
      good idea unless you know what you are doing (see BUGS below). 

git rebase ändern die Geschichte wird linearer. Da es Zusammenführungen im Verlauf gibt, müssen sie aufgelöst werden, wenn Konflikte auftreten, wenn der Zusammenführungspunkt abgeflacht ist.