PyCharm
 
Get PyCharm

Use patches

Last modified: 08 October 2024

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 in a Git repository.

If you do not need to save the patch to a file (for example, you want to send it by email instead), right-click the necessary file(s) in the Changes view and choose Copy as Patch to Clipboard from the context menu.

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