Get a file diff

Returns how one file changed between two refs: both versions and a unified patch.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Returns one file at two refs, with the patch that turns the base version into the head version. Useful with commit SHAs, for example to see what one sync changed in a file.

Response fields

FieldDescription
statusADD, MODIFY, DELETE, or UNCHANGED when the file is the same at both refs. A path that exists at neither ref is also reported as UNCHANGED, with old and new both null.
binarytrue for a binary file, which carries no text and no patch.
additions, deletionsLines added and removed.
patchUnified diff; null when unchanged or binary.
oldContent at base; null when absent or binary.
newContent at head; null when absent or binary.
Query Params
string
required

The older ref: a branch name or commit SHA.

string
required

The newer ref: a branch name or commit SHA.

string
required

Repository path of the file.

Responses

Language
Credentials
OAuth2
LoadingLoading…
Response
Choose an example:
application/json