How do I do an interactive reload with Intellij IDEA?

I want to make an interactive rabad of a branch like:

git rebase -i HEAD~4

Couldn't find a way to do this in IntelliJ IDEA. Please advice if at all possible. Thank.

+3


source to share


2 answers


The redirect dialog in IntelliJ 12.1 uses the most general version of the rebase command:

git rebase [-i] [--onto newbase] [upstream] [branch]

      

where IntelliJ "Onto" matches --onto newbase

, IntelliJ "From" matches upstream, and IntelliJ "Branch" matches branch.

In the above git rebase command all parameters are optional, while in IntelliJ they are not. This means that you have to accept the git rebase command and express it using the general form shown above.

Note that what you actually do with the arguments to the rebase command determines the range of commits that will be replayed to the new target location. Usually a range upstream..branch

. If you are not familiar with commit ranges, you should read them.

Take a look at your example and assume you are on a branch:

git rebase -i HEAD~4

      



Let's first determine which range. Since you only have one argument HEAD~4

, this is ascending, i.e. Range HEAD~4..branch

or, in other words, HEAD~4..HEAD

on a branch of a branch. The question is, what is your purpose of --onto. If you avoid --onto

, then git assumes that your upstream is also yours --onto

.

This gives:

git rebase -i --onto HEAD~4 HEAD~4 branch

      

and now you can populate IntelliJ redirect dialog using

  • On: HEAD~4

  • From: HEAD~4

  • Industry: branch

IntelliJ actually forces you to think first and identify your range and target, which looks more complicated but prevents you from doing a reinstall without knowing what the result will be.

+14


source


You can use these UI features in Intellij IDEA if you are not very familiar with the git rebase -i

commands.

Open the source control tab ( View -> Tool windows -> Version Control

or with Alt+9

) Go to the history tab under the source control tool window. select the commit you want to start rebasing from right click on the commit and select the optioninteractively rebase from here



Select what you want to do from the dialog shown and rebase :) enter image description here

0


source







All Articles