mirror of
https://gitea.com/gitea/docs.git
synced 2025-03-17 06:50:28 +00:00
Files
1.4 KiB
1.4 KiB
date | slug | sidebar_position | aliases | |
---|---|---|---|---|
2023-05-23T09:00:00+08:00 | agit-setup | 12 |
|
AGit 设置
在 Gitea 1.13
版本中,添加了对 agit 的支持。
使用 AGit 创建 PR
AGit 允许在推送代码到远程仓库时创建 PR(合并请求)。 通过在推送时使用特定的 refspec(git 中已知的位置标识符),可以实现这一功能。 下面的示例说明了这一点:
git push origin HEAD:refs/for/main
该命令的结构如下:
HEAD
:目标分支refs/<for|draft|for-review>/<branch>
:目标 PR 类型for
:创建一个以<branch>
为目标分支的普通 PRdraft
/for-review
:目前被静默忽略
<branch>/<session>
:要打开 PR 的目标分支-o <topic|title|description>
:PR 的选项title
:PR 的标题topic
:PR 应该打开的分支名称description
:PR 的描述force-push=true
: 是否强制更新目标分支- 注意: 如果不传值,只用
-o force-push
是无法正常工作的。
- 注意: 如果不传值,只用
下面是另一个高级示例,用于创建一个以 topic
、title
和 description
为参数的新 PR,目标分支是 main
:
git push origin HEAD:refs/for/main -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"