Skip to content

Instantly share code, notes, and snippets.

@eegrok
Created February 28, 2013 22:52
Show Gist options
  • Select an option

  • Save eegrok/5060836 to your computer and use it in GitHub Desktop.

Select an option

Save eegrok/5060836 to your computer and use it in GitHub Desktop.

Revisions

  1. eegrok created this gist Feb 28, 2013.
    8 changes: 8 additions & 0 deletions git-patch-example.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #this will save off a single commits patch, so you can apply it
    # if you leave off from --stdout to the right, it'll create a patchfile in the current directory with a name
    # that includes the comment from the commit
    git format-patch -1 095e61f --stdout > /tmp/patchname.patch
    # this will check the patch to see if any conflicts will arise when applying it
    git apply --check /tmp/patchname.patch
    # this will apply the patch
    git apply /tmp/patchname.patch