How to apply a Git patch to a file with a different name and path?

后端 未结 6 1066
终归单人心
终归单人心 2020-12-04 09:10

I have two repositories. In one, I make changes to file ./hello.test. I commit the changes and create a patch from that commit with git format-patch -1 HE

6条回答
  •  余生分开走
    2020-12-04 09:27

    Answering my own question with a script that does just this: https://github.com/mprpic/apply-patch-to-file

    Rather than modifying the patch file manually, it prompts the user for the target file, modifies the patch, and applies it to the repo you're currently in.

提交回复
热议问题