git apply
CautionApply raw diffs
git apply <file.patch>
Applies plain diffs; --check dry-runs, --3way falls back to merge on conflicts. For history-less diffs.
Examples
git apply --check fix.patchVerify it applies cleanly
Syntax
git apply [--check] [--3way] <patch>
Before you run it
Review before committing applied changes.
Related commands
- git format-patch / amMake and apply patches
- git diffShow diff
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store