Coregit
API Reference

Diff

Compare two refs and see file-level changes.

Compare Refs

GET /v1/repos/:slug/diff?base=main&head=feature-x

Response 200:

{
  "base": "7f3b...",
  "head": "a1c2...",
  "files": [
    {
      "path": "src/index.ts",
      "status": "modified",
      "old_sha": "d4e5...",
      "new_sha": "f6a7..."
    },
    {
      "path": "README.md",
      "status": "added",
      "old_sha": null,
      "new_sha": "b2c3..."
    }
  ],
  "total_files_changed": 2,
  "total_additions": 17,
  "total_deletions": 3
}

File Statuses

StatusMeaning
addedNew file in head
modifiedChanged between base and head
removedDeleted in head

Each file entry includes old_sha and new_sha (the blob SHAs before and after). null when the file didn't exist on that side.

On this page