I have two git repositories with a slightly different layout (both websites, one with a public_html directory, the other with a httpdocs directory).
When trying to move some changes from one to the other using a Patch file I need to stripe 2 pieces of the path and set a new Base Path.
The latter (the Base Path) is not processed in the Git command.
The full command by STREE with no trace of my Base Path is:
git -c diff.mnemonicprefix=false -c core.quotepath=false apply -v --reject -p 2 /path/to/patch.diff
Adding the --directory parameter makes this command work:
git -c diff.mnemonicprefix=false -c core.quotepath=false apply -v --reject -p 2 /path/to/patch.diff --directory httpdocs/