Create a git diff of a file from SourceTree

23,477

Solution 1

Assuming that this question is about the Git client SourceTree, here's how to create a patch file:

  1. in the Log/History view, right-click on a commit
  2. select the context menu option "Create Patch..."
  3. in the "Create Patch" dialog window, select the commits to include in the patch, choose the location of your patch file on the filesystem, and click "Create Patch".

Solution 2

In case you want to make a Patch from not committed changes (in other words from Patch from Working Copy):

  1. Choose your Uncommitted changes line List item
  2. Go to Actions
  3. Create Patch

enter image description here

  1. Choose the "Working Copy" Tab
  2. Tick the check box to select all files
  3. Click Create patch

Solution 3

git diff commitid1 commitid2 > patch.diff

Share:
23,477
Lakshmanaprabhu
Author by

Lakshmanaprabhu

Updated on September 23, 2021

Comments

  • Lakshmanaprabhu
    Lakshmanaprabhu over 2 years

    How to create a patch file from a Source Tree Actually, i need to create a patch file of a specific modified file. i can view this using External diff or git diff filename in git bash.