【问题标题】:git rebase - what's the difference between 'edit' and 'reword'git rebase - 'edit' 和 'reword' 有什么区别
【发布时间】:2015-05-12 15:06:22
【问题描述】:

当你执行 git rebase 时,editreword 有什么区别?

我正在浏览一些这样说的文档:

Replace pick with:
- edit to mark a commit for amending.
- reword to change the log message.

【问题讨论】:

  • 我刚刚在 Google 中输入了这个问题的确切标题! +1 有用的标题。

标签: git git-rebase git-rewrite-history


【解决方案1】:
  • “reword”允许您更改仅更改提交消息,而不更改提交内容
  • “edit”允许您更改提交内容和提交消息(git允许您编辑提交内容的机制是通过“暂停”变基;因此您可以修改提交)

参考git-rebase documentation 是这样说的:

  • edit :通过将命令“pick”替换为命令“edit”,您可以告诉 git rebase 在应用该提交后停止,以便您可以编辑文件和/或提交消息,修改提交,然后继续变基。
  • reword :如果您只想编辑提交的提交消息,请将命令“pick”替换为命令“reword”。

【讨论】:

  • 如果使用reword,原提交者的名字会改变吗?
  • 没有。下次请在谷歌上四处看看或发布一个新问题。
【解决方案2】:

edit 将完全暂停变基,允许您更改提交和/或提交消息中的文件。

reword 只会打开一个编辑器,让您只更改提交消息。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-05-15
    • 2015-03-21
    • 2011-09-11
    • 2011-03-22
    • 2012-06-28
    • 2017-06-30
    • 2021-09-30
    相关资源
    最近更新 更多