From 49dcc71f89768f359a53a3409e86a3cb3c0403ad Mon Sep 17 00:00:00 2001 From: MnPX <223180+emnpiex@noreply.gitea.com> Date: Sun, 2 Aug 2026 17:48:09 +0000 Subject: [PATCH] fix: AGit docs accurately reflect syntax (#474) there was confusing words around this. `HEAD` was mentioned twice and `origin` was used in place of a sensible option --------- Co-authored-by: MnPX Co-authored-by: lunny Reviewed-on: https://gitea.com/gitea/docs/pulls/474 Reviewed-by: Lunny Xiao Co-authored-by: MnPX <223180+emnpiex@noreply.gitea.com> --- docs/usage/issues-prs/agit.md | 27 ++++++++++--------- .../version-1.27/usage/issues-prs/agit.md | 27 ++++++++++--------- 2 files changed, 30 insertions(+), 24 deletions(-) diff --git a/docs/usage/issues-prs/agit.md b/docs/usage/issues-prs/agit.md index 872a98d1..1fc23c0f 100644 --- a/docs/usage/issues-prs/agit.md +++ b/docs/usage/issues-prs/agit.md @@ -19,30 +19,33 @@ Git version 2.29 or higher is required on the server side for this to work. ## Creating PRs with AGit AGit allows to create PRs while pushing code to the remote repo. -This can be done by pushing to the branch followed by a specific refspec (a location identifier known to git). +This can be done by pushing to a special refspec (a location identifier known to git) instead of to a branch. The following example illustrates this: ```shell -git push origin HEAD:refs/for/main +git push origin HEAD:refs/for/main -o topic="topic_of_my_PR" ``` The command has the following structure: -- `HEAD`: The target branch -- `origin`: The target repository (not a fork!) -- `HEAD`: The local branch containing the changes you are proposing -- `refs//`: The target PR type and configuration - - `for`: Create a normal PR with `` as the target branch - - `draft`/`for-review`: Currently ignored silently - - `/`: The branch you want your changes to be merged into -- `-o `: Options for the PR - - `topic`: The topic of this change. It will become the name of the branch holding the changes waiting for review. This is REQUIRED to trigger a pull request. +```shell +git push :refs/for/[/] [-o