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 chooseNumber of Commits
as1
.Then in the other repository you right click the repo and choose
Apply serial patch...
useAdd
to add the patch file created earlier. Then clickApply
.This should create a new commit in the other repository containing both the modification and the new file.