Last active
April 16, 2019 02:20
-
-
Save Integralist/13d9f5e8ec197e5e53c6 to your computer and use it in GitHub Desktop.
Get a git diff and apply git diff using gist ruby gem -> https://github.com/defunkt/gist (also see this alternative using `git format-patch`: https://gist.github.com/Integralist/87852ced09d7918322c0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git show HEAD HEAD~1 # (or use a hash instead: `git show {commit} {commit} {commit}`) | |
git diff --cached | gist -p -f test.diff | |
curl https://gist.githubusercontent.com/anonymous/x/raw/x/test.diff | git apply | |
curl https://gist.githubusercontent.com/anonymous/x/raw/x/test.diff | git apply --reverse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also generate a patch from a GitHub URL by adding a
.patch
extension to the end of a PR path or commit path.Then you can do a shortcut apply of the patch:
git am < foo.patch