GitHub Git API

Raw Git functionality.

Business capability
Software Construction Management BC-4200.40

Operations 13

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /repos/{owner}/{repo}/git/blobs Create a Git blob in a repository · GitHub Create a Blob #
Ask an LLM
“How do I upload raw file content as a Git blob without cloning the repo?”
“Can I create a blob from base64-encoded content instead of UTF-8 text?”
Tell an agent
Create a blob in {owner}/{repo} with the content {content}.
Store {content} as a {encoding}-encoded Git blob in {owner}/{repo}.
GET /repos/{owner}/{repo}/git/blobs/{file_sha} Get a Git blob by its SHA · GitHub Get a Blob #
Ask an LLM
“How can I read a file's contents from the Git database by its blob SHA?”
“Why is blob content always base64 encoded, and can I get it raw instead?”
Tell an agent
Get blob {file_sha} from {owner}/{repo}.
Fetch the contents of Git blob {file_sha} in the {repo} repository owned by {owner}.
POST /repos/{owner}/{repo}/git/commits Create a Git commit object · GitHub Create a Commit #
Ask an LLM
“How do I create a commit directly through the Git database from a tree SHA?”
“Can I set a custom author and committer on a low-level Git commit?”
Tell an agent
Create a commit in {owner}/{repo} with message {message} pointing at tree {tree}.
Make a Git commit object in {owner}/{repo} for tree {tree} with parents {parents} and message {message}.
GET /repos/{owner}/{repo}/git/commits/{commit_sha} Get a Git commit object by SHA · GitHub Get a Commit Object #
Ask an LLM
“How do I look up the raw Git commit object, including its tree and parents, for a SHA?”
“Can I check whether a commit's signature was verified?”
Tell an agent
Get Git commit object {commit_sha} from {owner}/{repo}.
Show the tree, parents and signature verification for commit {commit_sha} in {owner}/{repo}.
GET /repos/{owner}/{repo}/git/matching-refs/{ref} List Git references matching a prefix · GitHub List Matching References #
Ask an LLM
“How do I find all branches whose names start with feature/?”
“Can I list every tag reference that begins with v1 in a repository?”
Tell an agent
List all refs in {owner}/{repo} that match {ref}.
Find every branch or tag in {owner}/{repo} whose name starts with {ref}.
GET /repos/{owner}/{repo}/git/ref/{ref} Get a single Git reference · GitHub Get a Reference #
Ask an LLM
“What commit SHA does a specific branch point to right now?”
“How do I check if an exact tag reference exists in a repo?”
Tell an agent
Get the reference {ref} in {owner}/{repo}.
Tell me which SHA the exact ref {ref} points to in {owner}/{repo}.
POST /repos/{owner}/{repo}/git/refs Create a branch or tag reference · GitHub Create a Reference #
Ask an LLM
“How do I create a new branch from a commit SHA through the API?”
“Why can't I create a reference in an empty repository?”
Tell an agent
Create the ref {ref} in {owner}/{repo} pointing at {sha}.
Make a new branch {ref} in {owner}/{repo} starting from commit {sha}.
PATCH /repos/{owner}/{repo}/git/refs/{ref} Move a reference to a new commit · GitHub Update a Reference #
Ask an LLM
“How do I point an existing branch at a different commit?”
“Can I force-update a branch ref even when it isn't a fast-forward?”
Tell an agent
Update the ref {ref} in {owner}/{repo} to point at {sha}.
Force-move existing branch {ref} in {owner}/{repo} to commit {sha} (force: {force}).
DELETE /repos/{owner}/{repo}/git/refs/{ref} Delete a branch or tag reference · GitHub Delete a Reference #
Ask an LLM
“How do I delete a branch through the Git references API?”
“Can I remove a tag ref from a repository without deleting the commit?”
Tell an agent destructive · confirm first
Delete the reference {ref} from {owner}/{repo}.
Remove branch ref {ref} in the {repo} repository owned by {owner}.
POST /repos/{owner}/{repo}/git/tags Create an annotated tag object · GitHub Create a Tag Object #
Ask an LLM
“How do I create an annotated tag with a message and tagger through the API?”
“Does creating a tag object also create the refs/tags reference?”
Tell an agent
Create an annotated tag object {tag} in {owner}/{repo} on {object} with message {message}.
Make tag object {tag} for {type} {object} in {owner}/{repo} with the note {message}.
GET /repos/{owner}/{repo}/git/tags/{tag_sha} Get an annotated tag object by SHA · GitHub Get a Tag #
Ask an LLM
“How do I read the message and tagger of an annotated tag?”
“Can I see if a tag object's signature is verified?”
Tell an agent
Get tag object {tag_sha} from {owner}/{repo}.
Show the tagger, message and verification for annotated tag {tag_sha} in {owner}/{repo}.
POST /repos/{owner}/{repo}/git/trees Create a Git tree of files · GitHub Create a Tree #
Ask an LLM
“How do I build a new tree of file changes on top of an existing base tree?”
“Can I add or modify several files in one tree without touching the rest of the repo?”
Tell an agent
Create a tree in {owner}/{repo} with the entries {tree}.
Build a new tree in {owner}/{repo} from base tree {base_tree} with these changes {tree}.
GET /repos/{owner}/{repo}/git/trees/{tree_sha} Get a Git tree, optionally recursively · GitHub Get a Tree #
Ask an LLM
“How do I list every file in a repository at a given commit tree?”
“What happens when a tree response comes back truncated?”
Tell an agent
Get tree {tree_sha} from {owner}/{repo}.
List all files recursively in tree {tree_sha} of {owner}/{repo} (recursive: {recursive}).

Documentation

📖
Documentation
https://docs.github.com/en/rest/apps
📖
Documentation
https://docs.github.com/en/rest/codes-of-conduct/codes-of-conduct
📖
Documentation
https://docs.github.com/en/rest/emojis
📖
Documentation
https://docs.github.com/en/rest/gitignore
📖
Documentation
https://docs.github.com/en/rest/apps/installations
📖
Documentation
https://docs.github.com/en/rest/enterprise-admin
📖
Documentation
https://docs.github.com/en/rest/activity/events
📖
Documentation
https://docs.github.com/en/rest/orgs
📖
Documentation
https://docs.github.com/en/rest/rate-limit
📖
Documentation
https://docs.github.com/en/enterprise-cloud@latest/rest/scim
📖
Documentation
https://docs.github.com/en/rest/using-the-rest-api/getting-started-with-the-rest-api
📖
Documentation
https://docs.github.com/en/rest/teams
📖
Documentation
https://docs.github.com/en/rest/meta/meta
📖
Documentation
https://docs.github.com/en/rest/actions
📖
Documentation
https://docs.github.com/en/rest/branches
📖
Documentation
https://docs.github.com/en/rest/code-scanning
📖
Documentation
https://docs.github.com/en/rest/collaborators
📖
Documentation
https://docs.github.com/en/rest/dependabot
📖
Documentation
https://docs.github.com/en/rest/webhooks
📖
Documentation
https://docs.github.com/en/rest/pulls
📖
Documentation
https://docs.github.com/en/rest/git/tags
📖
Documentation
https://docs.github.com/en/rest/repos/autolinks
📖
Documentation
https://docs.github.com/en/rest/collaborators/invitations

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/github-git-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

github-git-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.1.4
  title: GitHub v3 REST Git API
  description: GitHub's v3 REST API.
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  x-github-plan: ghes
  x-github-release: 3.9
servers:
- url: '{protocol}://{hostname}/api/v3'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: HOSTNAME
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: http
tags:


# --- truncated at 32 KB (61 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/openapi/github-git-api-openapi.yml