Git Post-Update Hook – Can I handle “master” and “branches”?
I have a post-update hook in a repo that looks like:
#!/bin/sh echo echo "**** Pulling changes into Live [Hub's post-update hook]" echo cd DIR || exit unset GIT_DIR git pull hub master exec git-update-server-info
Is it possible for me to add conditions to this? I want to have it push to one directory if its a master
push and another if its a branch that has been pushed?
- Cannot get my post-commit script to run (git)
- Prevent commit before peer review in svn
- Git CHMOD post-receive hook
- git hooks: Detect which system is running
- How to get a list of incoming commits on git push for a new branch in a hook
- git tracking one file changes
Is this possible?
One Solution collect form web for “Git Post-Update Hook – Can I handle “master” and “branches”?”
It looks like it is possible to get branch information based on what is passed to the post-update:
BRANCH=$(git rev-parse --symbolic --abbrev-ref $1)