我经常以交互方式重新设置基础,以便在历史记录中进行微小的更改(例如,删除一个空行,或者编辑一行)。在大多数情况下,这些更改都是基于一些同行评审。
首先,我这样做我的更改:
git rebase --interactive 83bbeb27fcb1b5e164318fa17c55b7a38e5d3c9d~
# replace "pick" by "edit" on the first line
# modify code
git commit --all --amend --no-edit
git rebase --continue
如果在以下提交之一中存在合并冲突,我将解决它们并执行以下操作:
git rebase --continue
# the commit message is shown, but does not have to be changed, so I just save and exit the editor
git rebase --continue
# the commit message is shown, but does not have to be changed, so I just save and exit the editor
git rebase --continue
# the commit message is shown, but does not have to be changed, so I just save and exit the editor
...
是否有类似于git rebase --continue
的--no-edit
参数可以避开编辑器(类似于git commit
)?
发布于 2021-12-02 19:15:14
使用true
作为编辑器的技巧也可以通过如下所示的git别名来实现:
[alias]
continue = "-c core.editor=true rebase --continue"
然后使用git continue
而不是git rebase --continue
。
https://stackoverflow.com/questions/43489971
复制相似问题