2012-03-27 9 views
7

私のgitリポジトリには約2,000件のコミットがあります。教育目的のために、私はgit rebase -iで遊んでいます。 偶発的な競合で、Idempotent git rebaseが失敗しますか?

私はgit rebase -i first-commitを入力し

first-commitは、初期のタグであるレポにコミット)と(すなわち、すべての pick <hash>手つかずのまま)すべてでは何も変わらない、gitが私の歴史を再生開始しますが、競合を理由にコミットの数十に失敗しました。何が原因でしょうか?なぜ私は歴史全体を単に再生しないのですか?

答えて

6

私はオープンソースプロジェクトで再作成しようとしましたが、同様の結果が得られました。対話型のリベースを使用して最初のコミットの上にリベースするとコンフリクトが報告されました。

私はそれを2回実行し、同じコミットで起きていることに気付きました。成功したものの、オプション-pで再びリベースを実行している

* 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 

た:

-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のリベースが変更されます

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 

競合が合流点に近い起こっていたようです歴史はより線形になる。履歴にマージがあるため、マージポイントが平坦化されているときに競合が発生した場合は、解決する必要があります。

関連する問題