如何用git gui做rebase?

我知道如何从命令行执行git rebase,但是如何与官方的git-gui配合使用呢?

将其添加到您的主目录中的.gitconfig文件,以将工具菜单中添加.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 

git-gui

  1. 转到Tools -> Add ,然后input一个自定义命令即git rebase master
  2. select“ 全局添加”以使所有存储库都显示此选项。 (它会把你的configuration写到你的~/.gitconfig中,就像@Ted-Percival在他的回答中提到的那样)。

你可以用git gui完成一个完整的交互式rebase,完成commitselect,rewording和解决冲突! 除了Ted Percival的回答外,把这个添加到你的~/.gitconfig

 [guitool "Rebase interactive"] cmd = EDITOR=gvim git rebase -i $REVISION revprompt = yes 

必须使用graphics编辑器 – 简单的老vim不会工作,但gvim会。 你可以使用任何gui编辑器,例如我使用nedit 。 这个编辑器的一个单独的窗口将在您需要input任何内容时popup:最初select提交,重新提交提交消息(不论是reword还是squash提交)等等。

git gui可以用来添加文件到索引时做一个rebase --interactive (如在git rebase手册页 , GitHub rebase帮助页面或在这个git rebase交互式提示文章中提到 ),但不是执行rebase本身。
(除非如你所见,你自己在工具部分定义命令)