我知道如何从命令行执行 git rebase,但是您如何使用官方的git-gui执行此操作?
问问题
39035 次
4 回答
50
将此添加到.gitconfig
主目录中的文件中,以将变基命令添加到工具菜单:
[guitool "Rebase onto..."]
cmd = git rebase $REVISION
revprompt = yes
[guitool "Rebase/Continue"]
cmd = git rebase --continue
[guitool "Rebase/Skip"]
cmd = git rebase --skip
[guitool "Rebase/Abort"]
cmd = git rebase --abort
[guitool "Pull with Rebase"]
cmd = git pull --rebase
于 2012-02-08T19:32:36.893 回答
17
在git-gui
:
- 转到
Tools -> Add
然后输入自定义命令,即git rebase master
. - 选择全局添加以使该选项出现在所有存储库中。(正如@Ted-Percival 在他的回答
~/.gitconfig
中提到的那样,它将为您写入配置)。
于 2011-01-28T16:53:46.800 回答
5
您可以使用 进行完整的交互式变基git gui
,包括提交选择、改写和冲突解决!除了 Ted Percival 的回答,将此添加到您的~/.gitconfig
:
[guitool "Rebase interactive"]
cmd = EDITOR=gvim git rebase -i $REVISION
revprompt = yes
您必须使用图形编辑器——普通的旧版vim
无法使用,但gvim
可以。您可以使用任何 gui 编辑器,nedit
例如我使用的。每当您需要输入某些内容时,都会弹出此编辑器的单独窗口:最初选择提交、重新编写提交消息(无论是重新编写还是压缩提交)等。
于 2014-03-02T22:49:12.203 回答
4
git gui
可用于在执行 a 时将文件添加到索引rebase --interactive
中(如git rebase
手册页、GitHub rebase 帮助页面或此git rebase 交互式提示文章中所述),但不能执行rebase
本身。
(除非如您所见,您在工具部分自己定义命令)
于 2011-01-28T19:25:47.900 回答