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.
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.)
Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot