Git 合并操作与支持文件使用指南
1. Git 交互式变基中的编辑提交
在 Git 的交互式变基中,编辑操作是一个强大的功能。当交互式变基执行到编辑操作并停止时,你可以在本地进行任何所需的更改,比如编辑或添加文件,然后将这些更改添加到暂存区。接着,你可以使用带有 --amend 选项的 commit 命令来修改当前提交,将暂存区的更新合并到该提交中。完成更改提交后,使用 --continue 选项让变基继续进行。当因编辑操作停止时, git status 命令会显示更多详细信息和建议,示例如下:
$ git status
interactive rebase in progress; onto a55d7ef
Last commands done (4 commands done):
x echo "editing C4"
e 44972d5 C4
(see more in file .git/rebase-merge/done)
No commands remaining.
You are currently editing a commit while rebasing branch 'master' on 'a55d7ef'.
(use "git commit --amend" to amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
nothing t
超级会员免费看
订阅专栏 解锁全文
1471

被折叠的 条评论
为什么被折叠?



