Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rebase in IntelliJ IDEA?

How can I do the following in the IntelliJ IDEA?

$ git checkout my-local-branch
$ git rebase master -i
like image 805
Jan Tajovsky Avatar asked Apr 13 '16 12:04

Jan Tajovsky


People also ask

How do you do rebasing?

One way is to open the files in a text editor and delete the parts of the code you do not want. Then use git add <file name> followed by git rebase --continue . You can skip over the conflicted commit by entering git rebase --skip , stop rebasing by running git rebase --abort in your console.

What is rebase current onto selected IntelliJ?

If the remote branch doesn't exist locally, IntelliJ IDEA will silently create a tracked local branch, checkout into it and rebase. Rebase Current onto Selected (for both remote and local branches) to rebase the branch that is currently checked out on top of the selected.

Which is the correct command for rebase?

To check out the original <branch> and remove the .git/rebase-apply working files, use the command git rebase --abort instead. NOTE: The latter form is just a short-hand of git checkout topic followed by git rebase master .


2 Answers

Intelij IDEA UI has changed. For Version of 2020.2.3 like is the following:

enter image description here

like image 163
fgul Avatar answered Sep 28 '22 14:09

fgul


Easiest way: just open the git console in intellij and type it.

Otherwise, the Git Integration plugin in intellij, at least from version 8.1, has a Rebase onto function.

(accessible at the bottom right of your screen, where it says "Git: " - click, get up the "branches" popup, choose a branch).

Edit: there's also a dialog accessible via the intellij menu: VCS -> Git -> Rebase...

Documentation:

  • IntelliJ 2016.1
  • IntelliJ 2021.1
like image 27
vikingsteve Avatar answered Sep 28 '22 13:09

vikingsteve