How can I make git am / git apply work “fuzzy” like the patch command
You can do the following: git am /path/to/some.patch patch -p1 < /path/to/some.patch git add . git am –continue That would apply the patch and keep the commit message, etc.
You can do the following: git am /path/to/some.patch patch -p1 < /path/to/some.patch git add . git am –continue That would apply the patch and keep the commit message, etc.
I always have to Google this but the way I’ve found that works perfectly (for me) is: Create the patch with git diff –no-prefix master..branch > somefile.diff, the master and branch part are optional, depends how you want to get your diffs. Send it wherever and apply with patch -p0 < somefile.diff. It always seems …
Try: git format-patch -1 <sha> or git format-patch -1 HEAD According to the documentation link above, the -1 flag tells Git how many commits should be included in the patch; -<n> Prepare patches from the topmost commits. Apply the patch with the command: git am < file.patch