Is there a way to integrate SourceTree with Stash or BitBucket, such that a pre-push git-hook could be specified server-side, and automatically installed on SourceTree clients?
This is not about pre-receive git-hooks. We're specifically looking for a way to deploy a pre-push git-hook to everyone on the team.
The usual pattern for this is to commit the hook to the repository (e.g. hooks/pre-push
) and then get each team member to symlink (or copy) it into their .git/hooks directory:
ln -s hooks/pre-push .git/hooks/pre-push
There is no way to enforce that a git hook runs on the client-side, you must rely on your developers to install it themselves (I usually document the process in the repositories README) and, for important hooks - e.g. running tests or lint tools - run them on the server as well.
I'm accepting this answer, although I'm also putting in a suggestion for SourceTree. We're always looking for ways to utilize team settings to enforce standards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As Tim writes, this is an unsolved problem, normally addressed with conventions.
With the Commit Policy Plugin, we use a different approach to install dynamically generated client-side commit-msg scripts:
So far, it works fine. (As the scripts are dynamic, we can't include them directly in the repo content.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We're looking to enforce "all unit tests and integration tests must be run before a push". While we have these running on the server to, we'd rather our devs be pro-active then re-active when it comes to hunting down problem areas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't believe there is. Out of interest, roughly what do you want to do in the client side hook?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.