Reputation: 5666
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?
Upvotes: 12
Views: 14328
Reputation: 3175
Merge your branch with changes to source branch using VCS -> Git -> Merge changes with Squash commit option. After merge no commit will be done, but you will see changes in a single Changelist. You can click on this Changelist with right mouse button and select Create Patch from local changes option to export patch file. Then you can just revert.
Upvotes: 3
Reputation: 166
In IntelliJ IDEA 2020.2 I was able to make it like this:
Upvotes: 15
Reputation: 582
Here's how to do it on IntelliJ 2020.1.3
my-committed-branch
)my-uncommitted-branch
my-committed-branch
. It will show the list of files you have changed. Select all and click ok. You will now have all your changes as uncommitted changesUpvotes: 1
Reputation: 692
You can create a patch in the commit changes dialog.
1. go to local changes in version control and press ctrl+k
to invoke commit dialog
2. fill in the required fields and then instead of pressing the commit button there is a dropdown arrow next to commit that you can select to create a patch.
https://www.jetbrains.com/help/idea/commit-and-push-changes.html#invoke-commit-dialog
Upvotes: 1