Can I get a patch-compatible output from git-diff?
- by Malvolio
I am doing something very simple wrong. I'm trying to prepare an ordinary patch file, so I can reapply some changes:
$ git diff > before
$ git diff something_here > save.patch
$ git checkout .
$ patch < save.patch
$ git diff > after
$ diff before after
$
With something_here blank it almost works, but the file names aren't right. I think I'm just I'm missing some option.
In real life, I am going to do a merge after the checkout, so the patch might fail there, but you see what I'm getting at.