Can I get a patch-compatible output from git-diff?

Posted by Malvolio on Stack Overflow See other posts from Stack Overflow or by Malvolio
Published on 2011-01-06T00:39:03Z Indexed on 2011/01/06 0:53 UTC
Read the original article Hit count: 122

Filed under:

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.

© Stack Overflow or respective owner

Related posts about git