I would like to have a hook to run my tests before I push my changes to the remote (which sits on bitbucket).
I usually branch off master and when the feature is done I merge it back to master and push, which is why I was looking for the pre-push hook. Instead, I have used a post-merge & a pre-commit restricted to the master branch.
I’ve seen that patch done for Git 1.6 and this other question that raises exactly my problem with it’s proposed solution.
What I would like to know is why git does not support the pre-push hook then (especially if a patch has been accepted already once)?
(btw – I’m on the latest git version)
It, in my opinion, has always been a question of when and not why.
Git got the
pre-pushhook in the1.8.2release.Sample
pre-pushscript: https://github.com/git/git/blob/87c86dd14abe8db7d00b0df5661ef8cf147a72a3/templates/hooks–pre-push.sample1.8.2 release notes talking about the new pre-push hook: https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.2.txt