0

it's a simple question, how do I generate a file that contains code difference between two branches for ALL files using git? I'm almost certain that I've seen it on stack overflow some time ago but I searched now and could not find it.

Thanks

Lucas
  • 3,181
  • 4
  • 26
  • 45
  • See http://stackoverflow.com/questions/9834689/comparing-two-branches-in-git git diff branch_1..branch_2 – chmike Feb 18 '15 at 14:57

2 Answers2

0

You can use something like this:

git diff >> test.diff
siavolt
  • 6,869
  • 5
  • 24
  • 27
0

If you are planning to create a patch file and apply it, you can do

git diff branch1..branch2 --no-prefix > patchfile

followed by

patch -p0 < patchfile

to apply the patch.

If you want to just create a file, you can skip the --no-prefix option

hyun903
  • 16