4

I need to get the patch/diff between the development and my feature branch.

How can I get this using git command.

Please consider the branch names be development and test. I need to get the differences from test and development branch.

Edit:

I have followed the steps provided in the below question: Comparing two branches in Git?

The differences are shown in the git terminal only.

How can I save the differences into a patch or diff file?

Venkat
  • 2,478
  • 2
  • 24
  • 56

2 Answers2

8

try

git diff development..test > patch_name.patch

this will create the patch. apply the patch wherever you want.

2

You can also create a patch file using : git format-patch master..dev --stdout > patch.patch

This creates patches in email format that I find a little bit more readable. Also note that the above command creates a single file for all patches.

These files can be applies to the repo using git am

Yogesh_D
  • 15,585
  • 9
  • 35
  • 50