Get commits
Retrieve a list of commits from a repository.
Parameters
The username or organization name that owns the repository
The branch, tag, or commit reference to retrieve commits from. Defaults to the default branch if not specified
Maximum number of commits to return (depth). If not specified, returns all commits
Response
Returns an array of commit objects.
The commit object ID (SHA-1 hash)
Information about the commit authorUnix timestamp when the commit was authored
Information about the committerCommitter’s email address
Unix timestamp when the commit was committed
Array of parent commit OIDs
Example request
curl -X GET "https://api.gitflare.dev/api/commits?owner=johndoe&repo=my-project&ref=main&limit=10"
Example response
[
{
"oid": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
"message": "Add user authentication feature",
"author": {
"name": "John Doe",
"email": "[email protected]",
"timestamp": 1709568000
},
"committer": {
"name": "John Doe",
"email": "[email protected]",
"timestamp": 1709568000
},
"parent": ["b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1"]
},
{
"oid": "b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1",
"message": "Initial commit",
"author": {
"name": "John Doe",
"email": "[email protected]",
"timestamp": 1709481600
},
"committer": {
"name": "John Doe",
"email": "[email protected]",
"timestamp": 1709481600
},
"parent": []
}
]
Get commit details
Retrieve detailed information about a specific commit, including the files changed.
Parameters
The username or organization name that owns the repository
The commit object ID (SHA-1 hash) to retrieve details for
Response
Returns an object containing commit details and file changes.
The commit objectThe commit object ID (SHA-1 hash)
Information about the commit author
Information about the committer
Array of parent commit OIDs
Array of file changes in the commitFile path relative to repository root
Type of change: add, modify, or delete
Previous blob OID (for modifications and deletions)
New blob OID (for additions and modifications)
Example request
curl -X GET "https://api.gitflare.dev/api/commit?owner=johndoe&repo=my-project&commitOid=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0"
Example response
{
"commit": {
"oid": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
"message": "Add user authentication feature",
"author": {
"name": "John Doe",
"email": "[email protected]",
"timestamp": 1709568000
},
"committer": {
"name": "John Doe",
"email": "[email protected]",
"timestamp": 1709568000
},
"parent": ["b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1"]
},
"changes": [
{
"path": "src/auth/login.ts",
"type": "add",
"newOid": "c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2"
},
{
"path": "src/utils/helpers.ts",
"type": "modify",
"oldOid": "d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3",
"newOid": "e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4"
},
{
"path": "src/old-auth.ts",
"type": "delete",
"oldOid": "f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5"
}
]
}