Forgejo/docs/content/doc/usage/agit-support.zh-cn.md
Giteabot 7f3cc1446a
zh-cn translation for usage docs (#24897) (#24977)
Backport #24897 by @Zettat123

- [x] agit-support
- [x] clone-filter
- [x] incoming-email
- [x] labels
- [x] linked-references
- [x] merge-message-templates
- [x] permissions
- [x] profile-readme
- [x] protected-tags
- [x] push
- [x] repo-mirror
- [x] secrets
- [x] template-repositories
- [x] webhooks

Co-authored-by: Zettat123 <zettat123@gmail.com>
(cherry picked from commit 3a7e0953c1)
2023-05-30 08:11:45 +02:00

1.5 KiB
Raw Blame History

date title slug weight toc draft aliases menu
2023-05-23T09:00:00+08:00 Agit 设置 agit-setup 12 false false
/zh-cn/agit-setup
sidebar
parent name weight identifier
usage Agit 设置 12 agit-setup

Agit 设置

在 Gitea 1.13 版本中,添加了对 agit 的支持。

使用 Agit 创建 PR

Agit 允许在推送代码到远程仓库时创建 PR合并请求。 通过在推送时使用特定的 refspecgit 中已知的位置标识符),可以实现这一功能。 下面的示例说明了这一点:

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 的选项
    • titlePR 的标题
    • topicPR 应该打开的分支名称
    • descriptionPR 的描述
    • force-push:确认强制更新目标分支

下面是另一个高级示例,用于创建一个以 topictitledescription 为参数的新 PR目标分支是 master

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"