Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do a rebase with git gui?

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

like image 330
Leif Gruenwoldt Avatar asked Jan 28 '11 16:01

Leif Gruenwoldt


People also ask

How do I start git rebase?

Git rebase interactive in the console To use git rebase in the console with a list of commits you can choose, edit or drop in the rebase: Enter git rebase -i HEAD~5 with the last number being any number of commits from the most recent backwards you want to review. In vim, press esc , then i to start editing the test.

What is the command for git rebase?

Additional rebase commandsgit rebase -- p leaves the commit as is. It will not modify the commit's message or content and will still be an individual commit in the branches history. git rebase -- x during playback executes a command line shell script on each marked commit.


2 Answers

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 
like image 78
Ted Percival Avatar answered Oct 01 '22 15:10

Ted Percival


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).
like image 35
Leif Gruenwoldt Avatar answered Oct 01 '22 15:10

Leif Gruenwoldt