Search code examples
eclipsegitegit

How can I do the equivalent of git rebase -i HEAD~2 in eGit?


I know how to rebase onto a specific branch or tag using eGit in Eclipse, but I haven't found a way to rebase onto a specific sha1 using eGit. I'd like to do this in order to squash commits before pushing to upstream (ie, doing git rebase -i HEAD~n where n is some number of commits ago where I want to rebase). Is this possible with eGit? If not, is there another Eclipse plugin I should be using that would provide this functionality?


Solution

  • It is currently available in Eclipse Oxygen, it has it's own wizard for it.

    1. Get the branch you want in the History view
    2. Right-click the commit before the one you want to change
    3. Find Rebase interactive and click it
    4. The Rebase wizard will show up with the commits available to work upon

    It works just like the console version, but on a GUI. Even if conflicts arise, it will help you through.