TortoiseGit:应用补丁跳过添加的文件 [英] TortoiseGit: apply patch skips added files

查看:388
本文介绍了TortoiseGit:应用补丁跳过添加的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个文件(一个修改了,一个新文件)被修改为提交。我想为此创建一个补丁。
我使用TortoiseGit创建了一个补丁,我可以看到补丁包含两个文件的变化。



但是,当我将这个补丁应用到某个存储库时,同时应用这两项更改,但新文件未添加显示。因此,如果我简单地说:git commit,新添加的文件就会错过提交。



这是TortoiseGit的错误还是我做错了什么?



我尝试使用'git --diff'创建补丁,但在这种情况下,它并不包含作为补丁一部分的添加文件。



感谢,
Vibhav Agrawal

解决方案使用TortoiseGit,您应该通过提交修改(修改和添加)来创建修补程序,右键单击回购并选择创建系列修补程序... 并选择作为 1



然后在另一个存储库中,右键单击repo并选择应用串行补丁... 使用添加添加之前创建的补丁文件。然后点击 Apply



这应该在包含修改和新文件的另一个存储库中创建一个新的提交。


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

解决方案

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.

这篇关于TortoiseGit:应用补丁跳过添加的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆