0

基本的に、私がやろうとしているのは、2つのブランチのマージプロセスで作成されたcommit5581ecb023a9を取り除くことです。私が到達しようとしているのは、すべてを一直線に並べることです。

git rebase -i 5581ecb023a9これまでのところ、実際の5581ecb023a9コミットは表示されていませんが、以前のいくつかの投稿に従って実行しようとしました。git rebase -i a19ba5850a205581ecb023a9コミットも表示されないものを試してみました。

それらすべてを一列に並べる方法について何かアイデアはありますか?

前もって感謝します。

4

2 に答える 2

0

論理的には1行でコミットを取得できますが、そうすることで履歴を書き換えます。

これは、gitの各リビジョンがチェックサムに親IDを含むため、コミットのID(SHA1チェックサム)が異なることを意味します。これがgitを暗号的に安全にするものです(スナップショットからルートコミットまでのリポジトリ全体の整合性を簡単に検証できます)。

同じ「論理的」コミットを含むが、別のコミットにリベースまたはチェリーピックされたブランチを比較するには、次のようにします。

log --left-right --graph --oneline --cherry-pick BRANCH1 BRANCH2

git rev-listのマンページ(とりわけ)が説明しているように、--cherry-pick原因は

--チェリーピック

    Omit any commit that introduces the same change as another commit on
    the "other side" when the set of commits are limited with symmetric
    difference.

    For example, if you have two branches, A and B, a usual way to list all
    commits on only one side of them is with --left-right (see the example
    below in the description of the --left-right option). It however shows
    the commits that were cherry-picked from the other branch (for example,
    "3rd on b" may be cherry-picked from branch A).

    With this option, such pairs of commits are excluded from the output.
于 2012-07-12T21:56:49.613 に答える
0

これを行うには、マージのいずれかの側が共通の祖先から分岐するのコミットに対してリベースする必要があります。git rebse 8fedb6

于 2012-07-12T23:18:04.543 に答える