私はGitHub(Enterprise)でPRを行い、コミットはほとんどありません。私のレビューアが1に小さなミスを犯す識別:プルリクエストを修正するにはどうすればよいですか?
* a401341c Did this (HEAD -> foo)
* 08e97f86 Did that
* 616cd4ad Done that
* f3c6151b Accomplished this
* 1af6e74f Fix this <-- Error there
* a099fc19 Finished this
* ab726eb3 Cherry-picked this (master, origin/master)
私は補正を持つすべてのコミットを再適用、その後、競合せずにそれを戻すことはできませんので、最初のソリューションは1af6e74f
後にすべてのコミットを元に戻すことです。
* 0c99cf29 Reapply Did this (HEAD -> foo)
* 8806f36b Reapply Did that
* 572e1122 Reapply Done that
* 64ea3dc8 Reapply Accomplished this
* 81e20976 Fix this (this time correctly)
* d78a4534 Revert Fix this <-- Error there
* c0d817a9 Revert Accomplished this
* ed2bb3b2 Revert Done that
* ea34322a Revert Did that
* f81b78a3 Revert Did this
* a401341c Did this
* 08e97f86 Did that
* 616cd4ad Done that
* f3c6151b Accomplished this
* 1af6e74f Fix this <-- Error there
* a099fc19 Finished this
* ab726eb3 Cherry-picked this (master, origin/master)
次にgit push
私のPRを更新してください。
第二の溶液はgit push -f
git checkout 1af6e74f
git commit --amend -am "Fix this (with corrections)"
git rebase --onto a401341c f3c6151b HEAD # Not sure this will work as written
git branch -f foo HEAD
git push -f
を伴うだろうが、常に悪いもの良い解決策と後者の旧ソリューションですか?
私はどちらか使用しないだろう、私はブーイングブーイングを固定します新しいコミットでもちろん、ブランチをリベースした場合、履歴はよりクリーンになります。しかし、あなたの支店が誰にも分かれていない場合にのみリベースすることが望ましいでしょう。したがって、あなたの質問に対する答えは、ブランチが共有されていない場合、後者の解決法が良い解決法であるということです。 –
まあ、私はできません...私はちょうど私がパッチを適用することはできません私は 'git am mypatch'を使用したので、厳しい私の質問で明確にされていませんでした。特定のコミットを元に戻して変更する必要があります。 1回のコミットで 's/a \ w/b/g'と同じように、あとで' s/b/a/g'を実行することはできません。 – nowox
リベースすることができない場合は、なぜそれについて質問したのですか、あるいはこの疑問はただの仮説ですか? –