aboutsummaryrefslogtreecommitdiffstats
path: root/docs/content/usage/agit-support.zh-cn.md
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2023-07-25 23:53:13 -0500
committerGitHub <noreply@github.com>2023-07-26 04:53:13 +0000
commitbd4c7ce578956d9839309b16753bd5505b63b2e3 (patch)
tree1d3074ef542cee11707bc4985ce54dc40facb9b6 /docs/content/usage/agit-support.zh-cn.md
parent5dc37ef97a30628027a723ee944225a33a6511f8 (diff)
downloadgitea-bd4c7ce578956d9839309b16753bd5505b63b2e3.tar.gz
gitea-bd4c7ce578956d9839309b16753bd5505b63b2e3.zip
Docusaurus-ify (#26051)
This PR cleans up the docs in a way to make them simpler to ingest by our [docs repo](https://gitea.com/gitea/gitea-docusaurus). 1. It includes all of the sed invocations our ingestion did, removing the need to do it at build time. 2. It replaces the shortcode variable replacement method with `@variable@` style, simply for easier sed invocations when required. 3. It removes unused files and moves the docs up a level as cleanup. --------- Signed-off-by: jolheiser <john.olheiser@gmail.com>
Diffstat (limited to 'docs/content/usage/agit-support.zh-cn.md')
-rw-r--r--docs/content/usage/agit-support.zh-cn.md49
1 files changed, 49 insertions, 0 deletions
diff --git a/docs/content/usage/agit-support.zh-cn.md b/docs/content/usage/agit-support.zh-cn.md
new file mode 100644
index 0000000000..6a2ce1c373
--- /dev/null
+++ b/docs/content/usage/agit-support.zh-cn.md
@@ -0,0 +1,49 @@
+---
+date: "2023-05-23T09:00:00+08:00"
+title: "Agit 设置"
+slug: "agit-setup"
+sidebar_position: 12
+toc: false
+draft: false
+aliases:
+ - /zh-cn/agit-setup
+menu:
+ sidebar:
+ parent: "usage"
+ name: "Agit 设置"
+ sidebar_position: 12
+ identifier: "agit-setup"
+---
+
+# Agit 设置
+
+在 Gitea `1.13` 版本中,添加了对 [agit](https://git-repo.info/zh/2020/03/agit-flow-and-git-repo/) 的支持。
+
+## 使用 Agit 创建 PR
+
+Agit 允许在推送代码到远程仓库时创建 PR(合并请求)。
+通过在推送时使用特定的 refspec(git 中已知的位置标识符),可以实现这一功能。
+下面的示例说明了这一点:
+
+```shell
+git push origin HEAD:refs/for/master
+```
+
+该命令的结构如下:
+
+- `HEAD`:目标分支
+- `refs/<for|draft|for-review>/<branch>`:目标 PR 类型
+ - `for`:创建一个以 `<branch>` 为目标分支的普通 PR
+ - `draft`/`for-review`:目前被静默忽略
+- `<branch>/<session>`:要打开 PR 的目标分支
+- `-o <topic|title|description>`:PR 的选项
+ - `title`:PR 的标题
+ - `topic`:PR 应该打开的分支名称
+ - `description`:PR 的描述
+ - `force-push`:确认强制更新目标分支
+
+下面是另一个高级示例,用于创建一个以 `topic`、`title` 和 `description` 为参数的新 PR,目标分支是 `master`:
+
+```shell
+git push origin HEAD:refs/for/master -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok"
+```