Skip to content

@glimberg /post-commit
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Post Commit hook to automatically push to origin/branch
#!/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
@hedgehog

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.