我有一个git repo,它的分支名为development,标签为v1.14,我在不同位置有相同的repo,该站点不在Internet连接/慢速连接的范围内。
我需要为开发分支创建补丁并将其邮寄,以便可以应用它。
我的锻炼:
git format-patch --root v1.14 --stdout > ../git-for-mail/patches
在远程仓库中,我执行以下命令:
git am --ignore-whitespace < ~/workspace/git-for-mail/patches
我得到这些错误:
error: .gitignore: already exists in index
error: Gemfile: already exists in index
error: db/migrate/20140819091734_add_customer_number_to_location.rb: already exists in working directory
Patch failed at 0001 Implemented PC-81 & PC-77.
Applying: Adding Comments for PC-77
error: patch failed: lib/kitting/app/controllers/kitting/kit_copies_controller.rb:13
error: lib/kitting/app/controllers/kitting/kit_copies_controller.rb: patch does not apply
error: patch failed: lib/kitting/app/controllers/kitting/locations_controller.rb:6
error: lib/kitting/app/controllers/kitting/locations_controller.rb: patch does not apply
Patch failed at 0002 Adding Comments for PC-77
请让我知道是否有其他替代解决方案或破解解决方案。
提前致谢 !!!
桑托什·莫汉蒂(Santosh Mohanty)
使用该--root
标志,您的format-patch
命令将一直生成补丁,直到存储库中的第一次提交:
例子
提取自项目开始以来所有导致起源的提交:
$ git format-patch --root origin
这导致Git尝试创建您的遥控器上已经存在的提交。相反,找出远程存储库上的最新提交内容,然后从该位置创建补丁。
在远程存储库中:
git rev-parse --short HEAD # Outputs something like 1234abc
在您的本地存储库中,根据您刚刚创建的哈希值生成补丁程序:
git format-patch 1234abc..v1.14 --stdout > ../git-for-mail/patches
最后,使用原始命令将补丁程序应用到远程存储库。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句