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

前端 未结 5 1017
傲寒
傲寒 2020-12-07 07:43

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 some         


        
5条回答
  •  醉话见心
    2020-12-07 07:50

    A useful trick to avoid creating temporary patch files:

    git diff | patch -p1 -d [dst-dir]
    

提交回复
热议问题