Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA create patch from difference

I have IntelliJ IDEA Ultimate 2018.2.3. I am trying to create a patch from a difference (Compare with...) in IDE, but I can not find a button to do so. I have several commits on branch_A already. I do not need to create a patch from local changes, I need to create the patch from difference with another branch.

In git it simple git diff branch_A branch_B >> diff.patch

Is there any way to achieve it in the IDE?

like image 934
RoninDev Avatar asked Sep 14 '18 10:09

RoninDev


People also ask

How do I use diff in IntelliJ?

To assign shortcuts to the apply and append actions, open the Keymap page of the IDE settings Ctrl+Alt+S and locate these actions under Version Control Systems | Diff & Merge. on the toolbar. You can compare two or three files from the command line and use IntelliJ IDEA as an external diff tool.


1 Answers

In IntelliJ IDEA 2020.2 I was able to make it like this:

  1. Make sure you have no current local changes beforehand: commit them or put them to stash.
  2. VCS -> Git -> Branches -> [select branch to compare with] -> Show Diff with Working Tree
  3. [in opened difference view select needed files] -> [right mouse button] -> Get from Branch
  4. VCS -> Create Patch from Local Changes...
like image 58
ivankolyada Avatar answered Sep 23 '22 13:09

ivankolyada