.nh .TH "GT-COMMIT-DIFF" "1" "Nov 2026" "gitea-cli" "gitea-cli Manual" .SH NAME gt-commit-diff - Show the changes of a commit .SH SYNOPSIS \fBgt commit diff [flags]\fP .SH DESCRIPTION Show the changes of a commit as a unified diff, the same way gt pr diff does. .PP On a terminal the diff is colored and paged. Piped, it is written unchanged, so that gt commit diff 3f2a9c1 | git apply works. --patch writes the patch that git am takes, with the message and author. .PP --path and --exclude narrow the diff to files, as the file tree of the web interface does, and --name-only, --name-status and --stat summarize it. Gitea's API has no options for what a diff contains, such as ignoring whitespace, so these work on the diff after gt has read it. .SS ARGUMENTS .EX A repository can be supplied as NAME (one of yours), OWNER/NAME, HOST/OWNER/NAME or a URL. Without an argument, the repository of the current Git clone is used. .EE .SH OPTIONS \fB--color\fP="auto" Color the diff {auto|always|never} .PP \fB-e\fP, \fB--exclude\fP=[] Leave out files matching \fBpattern\fR, which is written like --path (repeatable) .PP \fB-h\fP, \fB--help\fP[=false] help for diff .PP \fB--name-only\fP[=false] List only the names of the changed files .PP \fB--name-status\fP[=false] List the changed files with A, M, D or R for how they changed .PP \fB--patch\fP[=false] Write the patch that git am takes, with the message and author .PP \fB--path\fP=[] Show only files matching \fBpattern\fR: a file, a directory/, or a glob such as '*.go' or 'internal/*\fI/\fP_test.go' (repeatable) .PP \fB--stat\fP[=false] Show how many lines each file changed, and the total, instead of the diff .PP \fB-w\fP, \fB--web\fP[=false] Open the commit in the browser .SH OPTIONS INHERITED FROM PARENT COMMANDS \fB--cwd\fP="" Working \fBdirectory\fR for repository discovery .PP \fB--debug\fP[=false] Log the method, URL, status, and duration of each HTTP request to stderr .PP \fB--host\fP="" Gitea instance \fBURL\fR, including any base path .PP \fB--interactive\fP[=false] Allow prompts with machine output .PP \fB--no-input\fP[=false] Disable prompts and implicit editor/browser interactions .PP \fB--remote\fP="" Git \fBremote\fR used for repository discovery .PP \fB-R\fP, \fB--repo\fP="" Select a repository as \fBOWNER/REPO\fR or URL .PP \fB--sudo\fP="" Perform API requests as this \fBuser\fR (requires an administrator account) .PP \fB--user\fP="" Account \fBname\fR on the selected instance .SH EXAMPLE .EX $ gt commit diff 3f2a9c1 $ gt commit diff v1.2.0 --stat $ gt commit diff main --path 'internal/' --exclude '*_test.go' $ gt commit diff 3f2a9c1 --patch > fix.patch .EE .SH SEE ALSO \fBgt-commit(1)\fP