There are two Repositories : project-version-1 and project-version-2.
project-version-1 dir has files : calculator/src/add.c calculator/src/subtract.c calculator/src/multiply.c and it does not have support for some feature (say division operation)
project-version-2 has the fix. But the fix is on new file say calculator/src/division.c
Problem :
I have to provide the patch(fix) to project-version-1 from the project-version-2 git repository. The patch should be a single diff file. we can't ask the customer do "git add new-file" etc. how do i generate a patch for this ?
You can add the new file in your
project-version-1and you need to add the file by using the following commands:This allows you to add an untracked file as your file is new.
And then add the modifications interactively by using
You will then obtain a console with the following message
And then you may edit to see or directly stage the whole new file as it a new file.
yis for accepting to stage andefor editThen to check your changes, you may
And if you are happy with your changes, you may then export it to a patch file by