Skip to content

Instantly share code, notes, and snippets.

@pferreir
Last active December 20, 2015 20:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pferreir/6193091 to your computer and use it in GitHub Desktop.
Save pferreir/6193091 to your computer and use it in GitHub Desktop.
# Add to project-level .git/config
[wip]
public = name-of-your-github-remote
# Add to global .gitconfig
[wip]
webhook = http://indicotest1.cern.ch:8000/wip/notification/
[alias]
push-wip = "!pushit() { export BRANCH=\"$(git-rev-parse --symbolic-full-name --abbrev-ref HEAD)\"; export REMOTE=\"$(git config --get wip.public)\"; export WEB_HOOK=\"$(git config --get wip.webhook)\" ; git-push $REMOTE $1 \"$BRANCH:wip/$BRANCH\" 2>&1 | tee /dev/tty | grep -q 'To ' && curl -sS $WEB_HOOK --data-urlencode \"branch=$BRANCH\" --data-urlencode \"name=$(git config --get user.name)\" --data-urlencode \"remote=`git remote show -n $REMOTE | sed -n 2p | sed 's/.*[:\\/]\\([a-zA-Z0-9\\-]*\\)\\/\\(.*\\)\\.git/\\1\\/\\2/'`\" > /dev/null ;}; pushit"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment