我想将两个文件从一个存储库移动到另一个。最初添加的文件为:跨几个重命名为两个文件创建Git修补程序
/src/init/Price.cs
/tests/init/PriceTests.cs
两个文件后来被更名为:
/src/init/PriceValue.cs
/tests/init/PriceValueTests.cs
,然后转移到:
/src/moved/PriceValue.cs
/tests/moved/PriceValueTests.cs
我试图通过this description去创建一组补丁对这些文件的,但我不知道该如何传递文件存在的六个不同路径。
我设法找到了所有影响PriceValue.cs
(横跨重命名和移动)提交身份证,但通过这些ID对Git的失败,出现以下错误信息:
$ git format-patch -o /tmp/pricevaluepatches $(git log --all dfeeb 6966b 9f882 …)
-bash: /usr/local/bin/git: Argument list too long
那么,如何创建一个这套修补程序只包含对所提及文件的更改,但在每个文件的一个重命名和一个移动中包含它?
你试过把所有的文件'ids.txt'(每行一个),并运行'猫ids.txt提交的ID | xargs git format-patch -o/tmp/pricevaluepatches'? –
另外,您不必在命令中运行'git log --all ...'。一个简单的'git format-patch -o/tmp/pricevaluepatches dfeeb 6966b 9f882 ...'应该就足够了。 –
@NilsWerner,感谢您的建议。不过,这只能解决一半的问题。从我的ID识别的提交,我怎么只适用影响'PriceValue.cs'和'PriceValueTests.cs'整个重命名和移动变化? –