我正在努力弄清楚如何编辑已推送到 GitHub 的 git 提交消息。我可以发誓,在过去我曾使用相同的命令来编辑已经推送的 git 提交,并且从来没有出现过任何问题。我现在遇到的问题是当我运行 git rebase --interactive <SHA of commit>
时我得到一些看起来像这样的东西......
noop
# Rebase 5d8e041..5d8e041 onto 5d8e041 (1 command(s))
#
# 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
# d, drop = remove commit
#
# These lines can be re-ordered; they are executed from top to bottom.
#
# If you remove a line here THAT COMMIT WILL BE LOST.
#
# However, if you remove everything, the rebase will be aborted.
#
# Note that empty commits are commented out
当我运行完全相同的命令但使用尚未推送到 GitHub 的 git 提交时,一切正常。有什么我想念的吗?就像我之前说过的那样,我可以发誓,这一次在推送和未推送的提交上都工作得很好。
非常感谢您的帮助,我非常感谢。
最佳答案
我的问题的最终答案 git rebase -i <sha>
甚至没有提出一个首选的编辑器来选择是否reword
提交消息或任何其他选项。答案是我使用的是 64bit
体系结构而不是 32bit
建筑学。现在,我真的不知道这是为什么,但我确实找到了 post在 GitHub 上谈论某些命令在 64bit
上失败架构,特别是git rebase
和某些git merge
按照那个帖子操作。还说……
leaves incomplete git operation and also adds a file on disk, sh.exe.stackdump with STATUS_STACK_OVERFLOW + register dump.
虽然我没有在 git 控制台中 pop 这个错误。当我在 SmartGit 中打开我的项目时,我得到了,这只是 git 的 GUI。当我在 git commit 消息之前右键单击我实际上想要 rebase 然后转到 Rebase Interactive From
的 git 消息时,就会发生这种情况。 .它不会立即通过错误,而是会尝试 10 秒,然后通过错误。
所以在这一点上,我已经弄清楚是什么导致了我的问题,但我还不知道为什么。为什么会 64bit
git 的架构版本运行方式不同于 32bit
一?头脑难以置信。如果有人有发生这种情况的具体原因,请继续并编辑我的帖子。
关于git - 如何使用 rebase 编辑推送的提交消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47008404/