Skip to content

Instantly share code, notes, and snippets.

@xudshen
Last active May 5, 2019 03:32
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 xudshen/41f670824f42b55a9f530214a61ec7ef to your computer and use it in GitHub Desktop.
Save xudshen/41f670824f42b55a9f530214a61ec7ef to your computer and use it in GitHub Desktop.
git config --global alias.make-patch '!bash -c "cd ${GIT_PREFIX:-.}; git add .; git commit -m ''uncommited''; git format-patch HEAD~1; git reset HEAD~1; mkdir -p ~/Dropbox/$(git config --get remote.origin.url)/$(git rev-parse HEAD); mv *.patch ~/Dropbox/$(git config --get remote.origin.url)/$(git rev-parse HEAD)/"'
git config --global alias.apply-patch '!bash -c "cd ${GIT_PREFIX:-.}; [ -d "~/Dropbox/$(git config --get remote.origin.url)/$(git rev-parse HEAD)" ] && cat ~/Dropbox/$(git config --get remote.origin.url)/$(git rev-parse HEAD)/*.patch | git am && git reset HEAD~1"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment