---
title: "Git"
description: "Hosted Git repositories in your project, cloned and pushed over HTTPS, with pull requests, branch rules, checks and Git LFS."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Git

EZGH Git hosts Git repositories in your project. Any Git client clones, fetches and pushes them over
HTTPS with an [API key](/iam/api-keys) or a bot's key. Agents can also read files and write commits
through the API, without a checkout. Changes are reviewed in **pull requests**, merged by merge
commit, squash or rebase, and gated by **branch rules** and **checks**. Large files go through
**Git LFS**.

- [Quickstart](/git/quickstart) — Create a repository, sign Git in with ezgh, clone and push.
- [Agents and the commit API](/git/agents) — Read files and write a commit in one call, without a checkout.
- [Pull requests](/git/pull-requests) — Open, review, comment on lines and merge.
- [Branch rules](/git/branch-rules) — Require pull requests, approvals and checks on a branch.
- [Git LFS](/git/lfs) — Store large files with the git lfs client.

The Git API is at `https://git-api.ezghcloud.com`. Git itself goes to each repository's clone URL.

## Repositories

A repository (`gtr_…`) is regional and lives in a project.

| Field | Meaning |
| --- | --- |
| `name` | 1–100 of `a-z`, `0-9`, `.`, `_` and `-`, starting with a letter or digit, not ending in `.git`. Unique in the project |
| `cloneUrl` | `https://<host>.git.ezghcloud.com/<name>.git`. Every repository in a project shares the host. Renaming a repository changes its URL |
| `defaultBranch` | `main` unless set |
| `allowedMergeMethods` | Which of `merge`, `squash` and `rebase` pull requests may use. All three unless set |
| `sizeBytes`, `lfsBytes` | Git data and Git LFS files stored, in bytes, as strings of digits |
| `links` | Services that read the repository for you, such as a Managed Hosting site. Removing one stops that service's access |
| `status` | `creating`, `active` or `deleting` |

[CreateRepository](/git-api/CreateRepository/) and [DeleteRepository](/git-api/DeleteRepository/)
answer `202` with an operation. A repository exists from the create on, `creating`, and is `active`
once the operation succeeds. Deleting removes its branches, tags, commits, pull requests and LFS
files; its name is free again at once.

## Paths in the API

A file path or a branch name goes in **one** path segment, with `/` percent-encoded:

```text
GET …/repositories/gtr_4k2m9x0a7qpe/contents/src%2Fmain.go?ref=release%2Fv2
DELETE …/repositories/gtr_4k2m9x0a7qpe/branches/feature%2Flogin
```

## Access

| Policy | Allows |
| --- | --- |
| `GitFullAccess` | Everything, including creating, configuring and deleting repositories and changing branch rules |
| `GitContributorAccess` | Clone, push, read files, open, review and merge pull requests, and report checks. Not creating, configuring or deleting repositories, or changing branch rules |
| `GitReadOnlyAccess` | View repositories, pull requests, reviews and checks. Not their files |

`ReadOnlyAccess` includes the same as `GitReadOnlyAccess`. Cloning and fetching need
`git.repositories.pull`, and reading files, commits and diffs through the API needs
`git.repositories.readContents`: neither is in a read-only policy.

`git.repositories.push`, `git.pulls.merge` and `git.pulls.approve` are also checked on the branch,
named as the repository's resource name followed by `/` and the branch:
`ezgh:us-west-1:org_…:prj_…:gtr_4k2m9x0a7qpe/release/*` covers every branch under `release/`, and
`…:gtr_4k2m9x0a7qpe/*` every branch of the repository. A policy on the repository alone
(`…:gtr_4k2m9x0a7qpe`) doesn't grant these on its branches. See [Branch rules](/git/branch-rules).

## Limits

| Limit | Value |
| --- | --- |
| Repositories per project | 100 (adjustable) |
| Branch rules per repository | 50 (adjustable) |
| Git data per project | 50 GiB (adjustable) |
| Git LFS files per project | 50 GiB (adjustable) |
| One push | 2 GiB |
| One Git LFS file | 5 GiB |
| One commit API request | 32 MiB |
| A diff | 300 files, and 1 MiB of patch per file; past either, `truncated` is `true` |

Too many requests are refused with `429` and `Retry-After`, which Git prints.

Source: https://docs.ezghcloud.com/git/index.mdx
