info:To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type:reference, howto
---
# Repository storage paths
# Repository storage paths
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/4578) in GitLab 8.10.
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/merge_requests/4578) in GitLab 8.10.
info:To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#designated-technical-writers
type:reference, howto
---
# Repository storage types **(CORE ONLY)**
# Repository storage types **(CORE ONLY)**
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/28283) in GitLab 10.0.
> - [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/28283) in GitLab 10.0.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196051) in GitLab 12.8 replacing Custom Hooks.
>
> - Server hooks were [introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/196051) in GitLab 12.8 replacing Custom Hooks.
Git supports hooks that are executed on different actions. These hooks run on the server and can be
> - Server hooks must be configured on the filesystem of the GitLab server. Only GitLab server administrators will be able to complete these tasks. Please explore [webhooks](../user/project/integrations/webhooks.md) and [GitLab CI/CD](../ci/README.md) as an option if you do not have filesystem access. For a user-configurable Git hook interface, see [Push Rules](../push_rules/push_rules.md), available in GitLab Starter **(STARTER)**.
used to enforce specific commit policies or perform other tasks based on the state of the
> - Server hooks won't be replicated to secondary nodes if you use [GitLab Geo](geo/replication/index.md).
repository.
Git natively supports hooks that are executed on different actions. These hooks run
Git supports the following hooks:
on the server and can be used to enforce specific commit policies or perform other
tasks based on the state of the repository.
-`pre-receive`
-`post-receive`
Examples of server-side Git hooks include `pre-receive`, `post-receive`, and `update`.
-`update`
See [Git SCM Server-Side Hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#Server-Side-Hooks)
See [the Git documentation](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks#_server_side_hooks)
for more information about each hook type.
for more information about each hook type.
## Create a server hook for a repository
Server-side Git hooks can be configured for:
Server-side Git hooks are typically placed in the repository's `hooks`
-[A single repository](#create-a-server-hook-for-a-repository).
subdirectory. In GitLab, hook directories are symlinked to the GitLab Shell
| `GL_REPOSITORY` | `project-<id>` where `id` is the ID of the project |
| GL_PROTOCOL (available starting 13.2) | Protocol used with push |
| `GL_USERNAME` | GitLab username of the user that initiated the push |
| GL_REPOSITORY | project-<id> where id of the project |
| GL_USERNAME | GitLab username that initiated the push |
Pre-receive and post-receive server hooks can also access the following Git environment variables.
Pre-receive and post-receive server hooks can also access the following Git environment variables.
...
@@ -143,38 +153,38 @@ Pre-receive and post-receive server hooks can also access the following Git envi
...
@@ -143,38 +153,38 @@ Pre-receive and post-receive server hooks can also access the following Git envi
| `GIT_PUSH_OPTION_<i>` | Value of push options where `i` is from `0` to `GIT_PUSH_OPTION_COUNT - 1`. See [Git `pre-receive` documentation](https://git-scm.com/docs/githooks#pre-receive). |
| `GIT_PUSH_OPTION_<i>` | Value of push options where `i` is from `0` to `GIT_PUSH_OPTION_COUNT - 1`. See [Git `pre-receive` documentation](https://git-scm.com/docs/githooks#pre-receive). |
NOTE: **Note:**
NOTE: **Note:**
While other environment variables can be passed to server hooks, your application
While other environment variables can be passed to server hooks, your application should not rely on
should not rely on them as they can change.
them as they can change.
## Transition to Go
## Transition to Go
> Introduced in GitLab 13.2 using feature flags.
> Introduced in GitLab 13.2 using feature flags.
The following server hooks have been reimplemented in Go:
The following server hooks have been re-implemented in Go:
-`pre-receive`, with the Go implementation used by default. To use the Ruby
-`pre-receive`, with the Go implementation used by default. To use the Ruby implementation instead,