I have a file called test_module.c that has some differences that I want to apply to my local working copy.
I tried to create patch file from the remote by doing the following. However, git didn’t complain about any errors. And didn’t create any patch file either.
git format-patch master/dev_branch test/test_module.c
It is possible to create a patch of a single file, that I can apply?
(Using git version 1.7.5.4)
If you give
git format-patcha single revision, it will produce patches for each commit since that revision. If you see no output from that command, then I suspect that there were no changes to that file betweenorigin/masterand your currentHEAD. As an alternative, you can provide a revision range (e.g.origin/master~3..origin/master) which covers the changes introduced to that file. Or, if the changes you want to produce a patch for are just contained in the single commit at the tip oforigin/master, you can use the-1parameter, as in: