IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Use patches

Last modified: 10 August 2022

Instead of committing your local changes, you can put them in a .patch file that you can apply to your sources later, send by email, and so on. Using patches is a convenient mechanism for sharing changes without checking them into to a VCS repository.

If you do not need to save the patch to a file, and want, for example, to send it by email or through a messenger, you can right-click a file in the Local Changes view and choose Copy as Patch to Clipboard from the context menu.

You can also copy a patch file content and apply it by choosing VCS | Apply Patch from Clipboard from the main menu. This is convenient when you receive a patch by email, for example, and do not want to save it. For Git format patches, IntelliJ IDEA extracts the commit message and the author and automatically fills the corresponding fields in the Commit tool window Alt+0.