Skip to content

Instantly share code, notes, and snippets.

@drautb
Created June 6, 2014 16:51
Show Gist options
  • Save drautb/3645aa0bef2301b961f5 to your computer and use it in GitHub Desktop.
Save drautb/3645aa0bef2301b961f5 to your computer and use it in GitHub Desktop.
Patching with Git
# Create a patch for a single commit
git format-patch -1 HEAD
# Or
git format-patch -1 <sha>
# Applying the patch
git apply --stat file.patch # show stats.
git apply --check file.patch # check for error before applying.
git am < file.patch # apply the patch finally.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment