How to do a rebase with git gui?

GitGit RebaseGit Gui

Git Problem Overview


I know how to do a git rebase from the command line, but how do you do it with the official git-gui?

Git Solutions


Solution 1 - Git

Add this to the .gitconfig file in your home directory to add rebase commands to the Tools menu:

[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

Solution 2 - Git

In git-gui:

  1. Go to Tools -> Add and then enter a custom command i.e. git rebase master.
  2. Select Add globally to have this option appear for all repositories. (It will write the configuration to your ~/.gitconfig for you, as @Ted-Percival mentioned in his answer).

Solution 3 - Git

You can do a full interactive rebase with git gui, complete with commit selection, rewording and conflict resolution! In addition to Ted Percival's answer, Add this to your ~/.gitconfig:

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

You must use a graphical editor -- plain old vim won't work, but gvim will. You may use any gui editor, I use nedit for example. A separate window of this editor will pop-up any time you need to input something: initially selecting commits, rewording commit messages (whether for reword or squash commits), etc.

Solution 4 - Git

git gui can be used to add files to the index when doing a rebase --interactive (as mention in thegit rebase man page, The GitHub rebase help page or in this git rebase interactive tip article), but not to perform the rebase itself.
(unless, as you saw, you define the command yourself in the Tools section)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLeif GruenwoldtView Question on Stackoverflow
Solution 1 - GitT PercivalView Answer on Stackoverflow
Solution 2 - GitLeif GruenwoldtView Answer on Stackoverflow
Solution 3 - GitIrfyView Answer on Stackoverflow
Solution 4 - GitVonCView Answer on Stackoverflow