Blog Insights Feature highlight: Git Hooks in GitLab Enterprise Edition
August 25, 2014
1 min read

Feature highlight: Git Hooks in GitLab Enterprise Edition

Sometimes you need additional control over pushes to your repository. For each project you can have unique Git Hooks.

Blog fallback hero

Sometimes you need additional control over pushes to your repository. GitLab already offers protected branches. But there are cases when you need some specific rules like preventing git tag removal or enforcing a special format for commit messages. GitLab Enterprise Edition offers a user-friendly interface for such cases.

For each project you can have unique Git Hooks. You can set them by going to Project settings -> Git Hooks.

Git Hooks

Here you can simply set a regular expression that requires your rule in a commit message. For instance, if you want every commit to reference a JIRA issue such as JIRA-123, you could use an expression such as /JIRA\-\d+/.

In addition, you can prevent users from deleting tags through pushes.

We're very excited about Git Hooks and are looking to add more. If you are a customer of GitLab and require a Git Hook, tell us and we can implement it for free.

We want to hear from you

Enjoyed reading this blog post or have questions or feedback? Share your thoughts by creating a new topic in the GitLab community forum. Share your feedback

Ready to get started?

See what your team could do with a unified DevSecOps Platform.

Get free trial

New to GitLab and not sure where to start?

Get started guide

Learn about what GitLab can do for your team

Talk to an expert