Reputation: 543
I have a git patch with two binary files (it's libraries, newly added). I tried to apply the patches but the binary files are not created. I tried git apply
with the --binary
option. Is there any other option to add the binary files from git patch? I only need the binary files.
Upvotes: 40
Views: 27942
Reputation: 1329892
I tried the git apply with --binary option.
That wouldn't affect anything: the git apply
man page mentions:
Historically we did not allow binary patch applied without an explicit permission from the user, and this flag was the way to do so. Currently we always allow binary patch application, so this is a no-op.
So check your git status
and permissions on your repo, as well as your git version.
As a test, try apply that patch on a new repo.
Upvotes: 6
Reputation: 9212
The --binary
option is used when you create the patch file, not when you apply it.
That means, instead of your current git diff branch1 branch2 > patch-file
, you have to do this instead: git diff branch1 branch2 --binary > patch-file
. And, then, apply the patch with git apply patch-file
in the same way as you're doing.
Upvotes: 48