---
title: "Edit a Git hook in a repository"
method: PATCH
path: "/repos/{owner}/{repo}/hooks/git/{id}"
tags: ["repository"]
---

# Edit a Git hook in a repository

`PATCH /repos/{owner}/{repo}/hooks/git/{id}`

## Path parameters

- `owner` string, required
- `repo` string, required
- `id` string, required

## Request body

- EditGitHookOption — EditGitHookOption options when modifying one Git hook
  - `content` string — Content is the new script content for the hook

## Response `200`

GitHook

- GitHook — GitHook represents a Git repository hook
  - `content` string — Content contains the script content of the hook
  - `is_active` boolean — IsActive indicates if the hook is active
  - `name` string — Name is the name of the Git hook

## Other responses

- `404` — APINotFound is a not found empty response

---

[API](https://skmtc.net/gitea/apis/gitea-api.md) · [All operations](https://skmtc.net/gitea/apis/gitea-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gitea/gitea-api/versions/350de506cefa/schema)
