TortoiseGit: apply patch skips added files

2019-09-03 09:26发布

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条回答
该账号已被封号
2楼-- · 2019-09-03 09:58

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.

查看更多
登录 后发表回答