gpt4 book ai didi

git - 从 "fixup!"中删除 `git commit --fixup HEAD` 消息

转载 作者:行者123 更新时间:2023-12-05 08:55:33 27 4
gpt4 key购买 nike

我经常使用 git rebase -i HEAD~N 压缩/修复我所有的临时提交,或者我刚刚提交的提交,然后再推送到上游。

我了解了 git commit --fixup HEAD,它可以帮助我避免多次击键。

问题是它在之前的提交消息中添加了“fixup!”,有什么方法可以让它停止这样做吗?

最佳答案

如果您只想将当前暂存的更改添加到您可能应该使用的最后一次提交

git commit --amend --no-edit

使用 --no-edit git 不会提示输入新的提交消息。

正如@phd 所说,fixup 需要与 rebase -i --autosquash 一起使用

关于git - 从 "fixup!"中删除 `git commit --fixup HEAD` 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45491723/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com