Wednesday, May 25, 2011

Creating a patch file with Eclipse 3.5 Git plugin

This process assumes the changes to the file to create a patch from have been committed. The process may not be very different for working changes yet to be committed.

  • Display the Git repository view if it is not visible:
    Window > Show view > Other ... > Git > Git Repositories.
  • Navigate to the desired file. This can be done quickly by turning on the link with editor behavior of this view if the file is open.
  • Right click on the file in the Git repository view and select 'Show in History'.
  • In the history view, right click on the commit that has the desired changes and select 'Create Patch...' then provide a destination for the file in the subsequent dialogs.