Search code examples
gitintellij-ideapatch

Creating patch of a git revision with Intellij


Is it possible at all?

It works with SourceTree by selecting a particular version in the history of the project, right clicking it and selecting create patch.
But the same option is disabled in Intellij for this setup.


Solution

  • It should be there in the Version Control tab. https://www.jetbrains.com/help/idea/2016.2/creating-patches.html

    Creating Patches

    IntelliJ IDEA suggests two ways of creating patches:

    1. On the base of revisions, either local or committed to the repository

    2. On the base of revisions stored in the local history.

    To create a patch file

    1. In the Local Changes tab or the Repository tab of the Version Control tool window, select a change or changelist you want to create a patch for.

    2. On the main Version Control menu or on the context menu of the selection, choose Create patch. enter image description here

    3. In the Create Patch dialog box that opens, review the list of changed files, and make sure that the files to be included in the patch are selected.

    4. Add a commit comment.

    5. Click Create patch.

    You can also create patch on the base of your local history. To do that, open the local history view for the desired directory, file or code fragment, as described in the section Using Local History, right-click the desired revision, and choose the Create Patch command on the context menu, or click the create patch button img on the toolbar.