Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Post Commit hook to automatically push to origin/branch

View post-commit
1 2 3 4 5 6 7 8 9
#!/bin/sh
#
# A hook script that is called after a successful
# commit is made.
#
# Place this file in .git/hooks and chmod +x
 
BRANCH=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
git push origin $BRANCH

Rather, try

BRANCH=$(git rev-parse --symbolic --abbrev-ref $(git symbolic-ref HEAD))

HTH?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.