首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何抑制` `git rebase --continue`的编辑器?

如何抑制` `git rebase --continue`的编辑器?
EN

Stack Overflow用户
提问于 2017-04-19 16:06:44
回答 1查看 4.7K关注 0票数 33

我经常以交互方式重新设置基础,以便在历史记录中进行微小的更改(例如,删除一个空行,或者编辑一行)。在大多数情况下,这些更改都是基于一些同行评审。

首先,我这样做我的更改:

代码语言:javascript
复制
git rebase --interactive 83bbeb27fcb1b5e164318fa17c55b7a38e5d3c9d~
# replace "pick" by "edit" on the first line
# modify code
git commit --all --amend --no-edit
git rebase --continue

如果在以下提交之一中存在合并冲突,我将解决它们并执行以下操作:

代码语言:javascript
复制
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)?

EN

回答 1

Stack Overflow用户

发布于 2021-12-02 19:15:14

使用true作为编辑器的技巧也可以通过如下所示的git别名来实现:

代码语言:javascript
复制
[alias]
    continue = "-c core.editor=true rebase --continue"

然后使用git continue而不是git rebase --continue

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43489971

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档