Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create a git diff of a file from SourceTree

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.

like image 582
Lakshmanaprabhu Avatar asked Mar 10 '14 10:03

Lakshmanaprabhu


People also ask

How do I create a diff file in SourceTree?

in the Log/History view, right-click on a commit. select the context menu option "Create Patch..." 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".

How do I create a patch for a single file?

You click on Actions->Create Patch... You click on "Working Copy Changes" You can now select all files that should be included into the patch file.


2 Answers

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".
like image 189
LoicAG Avatar answered Oct 21 '22 08:10

LoicAG


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
like image 39
Tung Fam Avatar answered Oct 21 '22 08:10

Tung Fam