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

后端 未结 6 1042
终归单人心
终归单人心 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条回答
  •  -上瘾入骨i
    2020-12-04 09:38

    FYI: I recently had problems trying to download a patch from Github and applying it to a local file (which was an "override" in a new location).

    git am wouldn't apply the patch either because the file was "not in index" or "dirty." But, I found that the simple patch command could apply the patch. It did prompt me for the name of the file to be patched.

    Got the job done, anyway ...

提交回复
热议问题