---
title: "Get a commit object"
method: GET
path: "/projects/{projectId}/git/commits/{repositoryCommitId}"
tags: ["Repository"]
---

# Get a commit object

`GET /projects/{projectId}/git/commits/{repositoryCommitId}`

Retrieve, by hash, an object representing a commit in the repository backing
a project. This endpoint functions similarly to `git cat-file -p <commit-id>`.
The returned object contains the hash of the Git tree that it
belongs to, as well as the ID of parent commits.

The commit represented by a parent ID can be retrieved using this
endpoint, while the tree state represented by this commit can
be retrieved using the
[Get a tree object](#tag/Git-Repo%2Fpaths%2F~1projects~1%7BprojectId%7D~1git~1trees~1%7BrepositoryTreeId%7D%2Fget)
endpoint.

## Path parameters

- `projectId` string, required
- `repositoryCommitId` string, required

## Response `default`

- Commit
  - `id` string, required — The identifier of Commit
  - `sha` string, required — The identifier of the commit
  - `author` object, required — The information about the author
    - `date` string, date-time, required — The time of the author or committer
    - `name` string, required — The name of the author or committer
    - `email` string, required — The email of the author or committer
  - `committer` object, required — The information about the committer
    - `date` string, date-time, required — The time of the author or committer
    - `name` string, required — The name of the author or committer
    - `email` string, required — The email of the author or committer
  - `message` string, required — The commit message
  - `tree` string, required — The identifier of the tree
  - `parents` string[], required — The identifiers of the parents of the commit

---

[API](https://skmtc.net/upsun/apis/upsun-com-rest-api.md) · [All operations](https://skmtc.net/upsun/apis/upsun-com-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/upsun/upsun-com-rest-api/revisions/6cc88fde6435/schema)
