TortoiseGit: apply patch skips added files

巧了我就是萌 提交于 2019-12-25 02:51:59

问题


I have 2 files (one modified and a new file) as modified for a commit. I want to create a patch for this. I created a patch using TortoiseGit and I can see that patch contains changes for both the files.

However, when I apply this patch into some repository, it applies both the changes but the new file is not shown as added. Due to this, if I simply say: git commit, the newly added file is missed out of commit.

Is this a bug of TortoiseGit or I am doing something wrong?

I tried to create a patch using 'git --diff' but in such a case, it does not include the added file as part of the patch at all.

Thanks, Vibhav Agrawal


回答1:


Using TortoiseGit, you should create the patch by committing your changes (the modification and the addition), right clicking the repo and choosing Create serial patch... and choose Number of Commits as 1.

Then in the other repository you right click the repo and choose Apply serial patch... use Add to add the patch file created earlier. Then click Apply.

This should create a new commit in the other repository containing both the modification and the new file.



来源:https://stackoverflow.com/questions/16025109/tortoisegit-apply-patch-skips-added-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!