.nh .TH "GT-REPO-SYNC" "1" "Nov 2026" "gitea-cli" "gitea-cli Manual" .SH NAME gt-repo-sync - Sync a branch with its remote or its fork's parent .SH SYNOPSIS \fBgt repo sync [] [flags]\fP .SH DESCRIPTION Fast-forward a local branch (default: the repository's default branch) to the same branch on the repository's Git remote, without switching branches. Diverged branches are left unchanged. .PP Given a repository without a Git remote here, sync updates it on the server instead: a fork fast-forwards to its parent, and a pull mirror fetches its source. Gitea updates a mirror as a whole and in the background, so --branch is refused for a mirror, and the JSON result names only the source, as remote. .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 .SS JSON FIELDS .EX branch, commit, previous, remote .EE .SH OPTIONS \fB-b\fP, \fB--branch\fP="" Branch to sync (default: the repository's default branch) .PP \fB-h\fP, \fB--help\fP[=false] help for sync .SH OPTIONS INHERITED FROM PARENT COMMANDS \fB--csv\fP[=""] Output CSV with the specified comma-separated \fBfields\fR, or all fields .PP \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-q\fP, \fB--jq\fP="" Filter JSON output using a jq \fBexpression\fR; implies --json .PP \fB--json\fP[=""] Output JSON with the specified comma-separated \fBfields\fR, or all fields .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--template\fP="" Format JSON output using a Go \fBtemplate\fR; implies --json (see gt help formatting) .PP \fB--user\fP="" Account \fBname\fR on the selected instance .SH EXAMPLE .EX # Fast-forward the default branch from the repository's remote $ gt repo sync # Fast-forward another branch $ gt repo sync --branch release/1.0 # Update a fork on the server from its parent $ gt repo sync bob/project .EE .SH SEE ALSO \fBgt-repo(1)\fP