1
https://review.openstack.org/#/c/64401/

上記は私が修正しようとしているコミットです

git commit -a --amend

しかし、私がするとき

git review -v

それは私に与えます

Running: git log --color=never --oneline HEAD^1..HEAD
Running: git remote
Running: git branch -a --color=never
Running: git branch --color=never
Running: git log HEAD^1..HEAD
Found topic 'fix-bug-1187277' from parsing changes.
Running: git rev-parse --show-toplevel
Running: git remote update gerrit
Fetching gerrit
Running: git rebase -i remotes/gerrit/master
Errors running git rebase -i remotes/gerrit/master
error: could not apply a062f76... Modify API ref for per-project-user quotas CRUD methods

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To check out the original branch and stop rebasing run "git rebase --abort".
Could not apply a062f76... Modify API ref for per-project-user quotas CRUD methods

ここで何をする必要があるのか​​ よくわかりませんか?試しgit rebase --abort git rebase --skip git rebase --continueましたが、解決しませんでした。

4

1 に答える 1

1

そこに、まさにそこにgit conflictがあります。あなたのコミットa062f76 - Modify API ref for per-project-user quotas CRUD methodsは、変更された行を変更しremotes/gerrit/masterています。

このスタックオーバーフローの回答では、git で競合を解決する方法について説明しています。それはあなたの知識への最高のリンクです。しかし、ここに私の見解があります:

実行git diffして、競合が何であるかを確認します。HEAD( theirs ) からの行とコミット ( ours ) からの行が見つかります。おそらく、 が表示されますがmerged common ancestors、これはわかりにくく、役に立たないと思います。コード内のこれらの行を見つけて修正し、最終的な状態が両当事者がコードで実行したいものになるようにします。他の誰かが意図した行を削除したり、コードを難読化したりする可能性があるため、注意してください。個人的には、そのような問題を回避するために、それらについて矛盾する行の作成者を見つけて話し合うことを好みます。

git checkout [--theirs|--ours] -- path/to/fileまたは、影響を受ける各パス (読み取り: ファイル) で、そのパスを特定のポイントに移動するために実行できます。ここで、theirsHEADそのパスへの最後のコミットでoursあり、最後のコミットです。前者は「自分のコードは欲しくない」と言い、後者は「自分のコードだけが欲しい、他の人は欲しくない」と言います。

あなたが幸せになったら、git rebase --continue働くべきです。別の競合が見つかった場合は、これらの手順をもう一度繰り返す必要があります。

読み物

于 2014-01-01T04:27:03.717 に答える