0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-28 18:34:10 -05:00
forgejo/docs/content/usage/merge-message-templates.zh-cn.md
John Olheiser bd4c7ce578
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>
2023-07-26 04:53:13 +00:00

53 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
date: "2023-05-23T09:00:00+08:00"
title: "合并消息模板"
slug: "merge-message-templates"
sidebar_position: 15
toc: false
draft: false
aliases:
- /zh-cn/merge-message-templates
menu:
sidebar:
parent: "usage"
name: "合并消息模板"
sidebar_position: 15
identifier: "merge-message-templates"
---
# 合并消息模板
## 文件名
PR 默认合并消息模板可能的文件名:
- `.gitea/default_merge_message/MERGE_TEMPLATE.md`
- `.gitea/default_merge_message/REBASE_TEMPLATE.md`
- `.gitea/default_merge_message/REBASE-MERGE_TEMPLATE.md`
- `.gitea/default_merge_message/SQUASH_TEMPLATE.md`
- `.gitea/default_merge_message/MANUALLY-MERGED_TEMPLATE.md`
- `.gitea/default_merge_message/REBASE-UPDATE-ONLY_TEMPLATE.md`
## 变量
您可以在这些模板中使用以下以 `${}` 包围的变量,这些变量遵循 [os.Expand](https://pkg.go.dev/os#Expand) 语法:
- BaseRepoOwnerName此合并请求的基础仓库所有者名称
- BaseRepoName此合并请求的基础仓库名称
- BaseBranch此合并请求的基础仓库目标分支名称
- HeadRepoOwnerName此合并请求的源仓库所有者名称
- HeadRepoName此合并请求的源仓库名称
- HeadBranch此合并请求的源仓库分支名称
- PullRequestTitle合并请求的标题
- PullRequestDescription合并请求的描述
- PullRequestPosterName合并请求的提交者名称
- PullRequestIndex合并请求的索引号
- PullRequestReference合并请求的引用字符与索引号。例如#1、!2
- ClosingIssues返回一个包含将由此合并请求关闭的所有工单的字符串。例如 `close #1, close #2`
## 变基Rebase
在没有合并提交的情况下进行变基时,`REBASE_TEMPLATE.md` 修改最后一次提交的消息。此模板还提供以下附加变量:
- CommitTitle提交的标题
- CommitBody提交的正文文本