LogoFreestyle
API ReferenceGit

Compare two commits

Get the comparison between two commits in a repository

GET
/git/v1/repo/{repo}/compare

Path Parameters

repo*string

The repository id

Formatuuid

Query Parameters

base*string

Base revision (commit SHA, branch name, tag, or any valid Git revision)

head*string

Head revision (commit SHA, branch name, tag, or any valid Git revision)

Response Body

application/json

curl -X GET "https://api.freestyle.sh/git/v1/repo/497f6eca-6276-4993-bfeb-53cbbbba6f08/compare?base=main&head=dev"
{
  "status": "identical",
  "ahead_by": 0,
  "behind_by": 0,
  "total_commits": 0,
  "files": [
    {
      "sha": "string",
      "filename": "string",
      "status": "added",
      "additions": 0,
      "deletions": 0,
      "changes": 0,
      "previous_filename": "string"
    }
  ]
}

Freestyle AI

Documentation assistant

Experimental: AI responses may not always be accurate—please verify important details with the official documentation.

How can I help?

Ask me about Freestyle while you browse the docs.