Skip to content

Instantly share code, notes, and snippets.

@demirhanaydin
Created July 3, 2015 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save demirhanaydin/6199040e96f3f5ed6389 to your computer and use it in GitHub Desktop.
Save demirhanaydin/6199040e96f3f5ed6389 to your computer and use it in GitHub Desktop.
Create and apply patch with Git
# source https://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/
git checkout -b fix_empty_poster
# do some commits to new branch
# create patch file
git format-patch master --stdout > fix_empty_poster.patch
# check stats
git apply --stat fix_empty_poster.patch
# check errors if any
git apply --check fix_empty_poster.patch
# apply it
git am --signoff < fix_empty_poster.patch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment