Skip to content

Instantly share code, notes, and snippets.

@Couto
Last active February 26, 2019 09:27
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 Couto/b4834ec4efc5f252c23f69a593db0ccd to your computer and use it in GitHub Desktop.
Save Couto/b4834ec4efc5f252c23f69a593db0ccd to your computer and use it in GitHub Desktop.
# Create the patch
git reset --hard origin/master
git format-patch -o /tmp -1 HEAD > /tmp/patch-name
# For each service
git checkout master
git pull --ff-only
git checkout -b "$(basename -s .patch $(cat /tmp/patch-name))"
git am -3 "$(cat /tmp/patch-name)"
# Fix any possible conflicts
git add -A
git am --continue
# Push to remote
git push --set-upstream origin "$(basename -s .patch $(cat /tmp/patch-name))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment