I have to apply a patch to my repo and am running
git apply --directory=$PWD xxxxx.patch
For reasons I won't go into, I cannot use git am in this instance, and I need to use the directory flag.
git tells me:
$> git apply --directory=$PWD xxxxx.patch
code1/xxxxx.patch:337: trailing whitespace.
< one partial line of code >
warning: 1 line adds whitespace errors.
I have read that the whitespace warning is nothing serious and should not stop git from applying the patch. However, whatever the reason, git is not applying the patch. None of the current files in the repo are changing. Any idea what to do about this?
git applyproduces this warning,git statusshows no changes ready to be added? That seems odd.git statusdisplays a line listing that patch but at the end it says "nothing added to commit". Just for grins I tiedgit commitafter the apply and gotnothing added to commitagain. And inspection of the files shows that no changes have been made.git applythinks none of the file names go with your files. Note the sentence early on in the documentation: "When running from a subdirectory in a repository, patched paths outside the directory are ignored." Maybe you want to leave out--directory=$PWDif you've already cd-ed into the sub-directory, or maybe you just need to run it from the top level (and not use$PWDhere).