Stash - Repository Templates?

Hello

today we are running "plain-git" installation with some shell scripts, which help us to procure standardised git repositories with specific update-hooks. Those hooks validate the author entry in a git-commit and deny them if they do not match ldap-entries. We found the "Enforce Author Hook for Stash"-PlugIn which would provide a simliar functionality, but we need to activate it for every new repository, which is error-prone. Is there a possiblity in Stash to provide a "template"-configuration, so new created repository has the same hooks enabled with the same configuration?

2 answers

2 votes

Hi Igor,

Unfortunately this feature is not yet available in Stash, though you can track its progress here:

https://jira.atlassian.com/browse/STASH-3597

by watching it and casting your vote there. For your reference this is how new features are prioritized in Stash:https://confluence.atlassian.com/display/STASH/New+features+policy

Thanks,

Gurleen

If it's native git hooks you want to add to newly created repositories you can just add them to:

/usr/share/git-core/templates/hooks
or
C:\Program Files\Git\share\git-core\templates\hooks

depending on system, and they'll be added to repos inited by Stash.

/David

Just to repeat a comment that's on the Stash-3597 issue above. If you do decide to add hooks to the default templates directory, make sure they're in a post-receive.d or pre-receive.d directories. Stash needs to hijack the normal files and if they get overriden by Git then Stash will stop behaving as expected. That said what would most likely happen is that Stash would override your default hooks every time, which wouldn't be desirable either.

Cheers,

Charles

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

638 views 0 4
Read article

Atlassian User Groups

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!

Find my local user group

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

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot