我試圖刪除第二次提交到回購。在這一點上我可能只是吹走.git
目錄,並重新做,但我很好奇,如何做到這一點...我已經刪除了提交之前,但顯然從未:第二個:)git:刪除第二次提交
> git log
commit c39019e4b08497406c53ceb532f99801793205ca
Author: Me
Date: Thu Mar 22 14:02:41 2012 -0700
Initializing registry directories
commit 535dce28f1c68e8af9d22bc653aca426fb7825d8
Author: Me
Date: Tue Jan 31 21:04:13 2012 -0800
First Commit
> git rebase -i HEAD~2
fatal: Needed a single revision
invalid upstream HEAD~2
> git rebase -i HEAD~1
此時我得到了我的編輯:
pick c39019e Initializing registry directories
# Rebase 535dce2..c39019e onto 535dce2
#
# Commands:
# p, pick = use commit
# r, reword = use commit, but edit the commit message
# e, edit = use commit, but stop for amending
# s, squash = use commit, but meld into previous commit
# f, fixup = like "squash", but discard this commit's log message
# x, exec = run command (the rest of the line) using shell
#
# If you remove a line here THAT COMMIT WILL BE LOST.
# However, if you remove everything, the rebase will be aborted.
#
現在我的問題是,我不能只是吹走這個第二個承諾,因爲「如果你刪除一切,底墊將被中止」
因爲那毫無意義地增加了另一個提交 – 2012-03-22 21:31:38
這是如何產生影響的?您已完成刪除更改的目標。 – bluesman 2012-03-23 17:04:58
由於我還沒有推送,並且在推送「提交」和「撤銷上次提交」時沒有看到任何意義。你的回答不是_wrong_,我更喜歡其他人:P – 2012-03-23 17:49:35