커밋이 거의없는 GitHub (Enterprise)에서 홍보를했습니다. 내 검토가 하나의 작은 실수를 발견 커밋 :풀 요청을 수정하기위한 해결책은 무엇입니까?
* 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)
: 그냥 다음, 충돌없이 되돌아 보정 모든 커밋을 다시 적용 할 수 없기 때문에
는
* 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
후 모든 커밋을 되돌리려하는 것입니다
다음 내 PR을 업데이트하려면 git push
.
두 번째 솔루션은 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'를 사용했기 때문이다. 특정 커밋을 되돌리고 변경해야합니다. 마치 한 번에's/a \ w/b/g'하는 것처럼, 나중에's/b/a/g'를 할 수는 없습니다. – nowox
rebase 할 수 없다면 왜 물어 보았습니까? 아니면 단지이 질문이 가상입니까? –