Skip to content

Instantly share code, notes, and snippets.

@sanmai
Last active March 9, 2016 01:37
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 sanmai/c5f37d38c73b51f12d96 to your computer and use it in GitHub Desktop.
Save sanmai/c5f37d38c73b51f12d96 to your computer and use it in GitHub Desktop.
Patch Flow

First:

git format-patch -1 <sha1>

Then:

git am ../path/to/0001-file.patch

If patch did not apply cleanly:

rejected-apply
wiggle-rej
git add -p
git diff --cached
git am --continue
git show -1
git pull && git push
rej-clean
#!/bin/bash
find . -type f -name \*orig -print -delete
find . -type f -name \*rej -print -delete
#!/bin/bash
set -o nounset -o errexit
test -f .git/rebase-apply/patch
rej-clean
patch -p1 < .git/rebase-apply/patch
#!/bin/bash
find . -name \*.rej |
while read rej
do
echo $rej
wiggle -r ${rej%.rej} $rej
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment