Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a patch in IntelliJ IDEA?

I've been using IntelliJ IDEA 9.0 Community Edition for some time after years living in Eclipse. One thing seems to be hard to find in it. I'd like to create a patch on some subfolder in my project. In Eclipse it is done using right click, Team, Create Patch.

Does anybody know how to do that in IDEA?

like image 796
Boris Pavlović Avatar asked Jan 13 '10 09:01

Boris Pavlović


People also ask

How do I patch a folder?

# to apply patch: # change working directory to <directory> cd <path_to>/<directory> patch -s -p0 < <path_to>/file. patch # -s or --silent or --quiet Work silently, unless an error occurs. # -pN or --strip=N Strip smallest prefix containing num leading slashes from files.

What is patch file in Java?

A "Patch" is the set of differences between two versions of the same file. Patches are used to send someone the exact changes that you have made to your version of a program or a document. They can then apply that patch to their version to merge the changes and bring their version up-to-date with your version.

What does the patch command do?

The patch command reads a source file's instructions on how to change a file, then applies the changes. The source file contains difference listings (or diff listings) produced by the diff -c or -u command, and one or more sets of diff command output, customarily called hunks.


2 Answers

Use the Changes view. In the group by directory mode you can right click on the directory with changes and choose Create Patch from the context menu.

like image 142
CrazyCoder Avatar answered Sep 22 '22 05:09

CrazyCoder


You can do a right click Local History -> Show History and then choose a revision and click on patch button (the second from the left)

like image 43
Patrick Avatar answered Sep 20 '22 05:09

Patrick