git rebase -i 提交标志?

标签 git git-rebase

当应用压缩或改写的提交时,rebase -i自动调用提交编辑器。我习惯于使用 commit -v (我想看看我提交了什么差异),但是 rebase 调用的 git commit好像没有设置-v .这在压缩提交时非常烦人。
有没有办法配置git commit用于内部的标志 rebase loop ?

最佳答案

来自 git-commit(1) :

-v, --verbose

Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template to help the user describe the commit by reminding what changes the commit has. Note that this diff output doesn’t have its lines prefixed with #. This diff will not be a part of the commit message. See the commit.verbose configuration variable in git-config[1].


这意味着可以通过执行全局永久启用详细模式
git config --global commit.verbose true
这样,-v从现在开始,选项将默认启用。
或者,可以通过传递 -c 在每个命令的基础上启用该选项。全局选项:
git -c commit.verbose=true rebase -i

关于git rebase -i 提交标志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66966464/

相关文章:

Git - 为我的工作流程 merge vs Rebase

git - 更改根提交父项以指向另一个提交(连接两个独立的 git 存储库)

Git克隆SSH - 致命的协议(protocol)错误

git - 在git中,保存不同版本快照的最佳方式是什么?

git - 如何设置 git 来处理需要不同代理的 Remote ?

git rebase merge 冲突无法继续

git - 如何在dockerfile中使用RUN clone git

linux - 你如何在 git 命令 ex 上放置一个包装器。混帐克隆

Git rebase 失败

git - 标签可以在 git filter-branch 和 rebase 之后自动移动吗?