1

I tried using the command

git diff branch1 branch2 -- folder/ > mypatch.patch

But when I use

git am --signoff mypatch.patch

I get an error

Patch format detection failed.
Farhad
  • 388
  • 2
  • 13
  • `git am` wants to read the kind of output provided by `git format-patch`, not just `git diff`. The output from `git diff` is suitable for `git apply` but not for `git am`. – torek Nov 03 '16 at 13:08

1 Answers1

0

Changes in current branch:

git log -p --since=10.days > mypatch.patch

Changes in current branch, but not in branch2:

git log HEAD --not branch2 -p --since=10.days > mypatch.patch

Changes in branch1, but not in branch2:

git log branch1 --not branch2 -p --since=10.days > mypatch.patch

You could also use --before in a similar fashion to specify upper date range:

git log -p --since=10.days --before=2.days > mypatch.patch

Documentation for git-log, sections "Commit Limiting" and "Common Diff Options".

Mykhailo
  • 1,134
  • 2
  • 17
  • 25