Skip to content

Instantly share code, notes, and snippets.

@msh5
Last active April 21, 2018 03:15
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 msh5/c73ac86e645deff00678ee843e889bda to your computer and use it in GitHub Desktop.
Save msh5/c73ac86e645deff00678ee843e889bda to your computer and use it in GitHub Desktop.
Push on-editing files as a WIP branch for sharing with an another machine.
#!/bin/sh
# curl https://gist.githubusercontent.com/msh5/c73ac86e645deff00678ee843e889bda/raw/git-wip-push.sh | sh
set -e
set -u
orgbr="$(git rev-parse --abbrev-ref @)"
wipbr="wip-$(date +%Y%m%d%H%M%S)"
git checkout -b $wipbr
git commit -a -m "wip"
git push origin $wipbr
git checkout $orgbr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment