从重命名的文件返回更改 [英] Backport changes from renamed file
问题描述
我不想合并一切,但只采取这个提交。樱桃选择失败并且被我们删除冲突(当然,新文件从未在生产分支中存在)。
什么是正确的方式更改为旧文件?
git show COMMIT_ID - old / file / name.txt | patch new / file / name.txt
I have two branches: trunk, production. I have found a problem in trunk, made fix and committed it, pushed it. Now it was tested and I need do merge changes into the production branch as a hot-fix. I try to use the cherry-pick. However it doesn't work because a changed file(s) in the fix was renamed in the trunk earlier during some refactoring which I don't want bring into production.
I don't want merge everything, but take only this commit. The cherry pick fails with "deleted by us" conflict (of course, the new file never even existed in the production branch).
What is the correct way to bring the changes into the old file?
I'd use good old patch for this:
git show COMMIT_ID -- old/file/name.txt | patch new/file/name.txt
这篇关于从重命名的文件返回更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!