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 Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...
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
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs