
如何为 TiDB 文档提交第一个 PR

今日已是 2024 年,2023 已成过往,去年我曾说,如果中国数据库的文档有排行榜,那么 TiDB 文档注定“遥遥领先”(褒义词)。
TiDB Docs Dash

2024 TiDB 文档挑战赛来啦!
首届 TiDB 文档挑战赛 (TiDB Docs Dash) 将于 2024 年 1 月 9 日 - 12 日进行。同时,我们也希望将借此机会将 TiDB 社区成员聚集到一起,为大家带来一次有趣的协作体验。
通过此次活动,你将有机会结识其他社区成员,与大家一起共同改进 TiDB 和 TiDB Cloud 文档。
详细活动介绍,请参阅帖子:TiDB 文档挑战赛 2024 来了!
或公众号文章:2024 TiDB 文档挑战赛|提 PR 和 Issue 来赢取 Bose 耳机、机械键盘等奖品吧!
TiDB 文档
TiDB 文档目前支持中、英、日三种语言。文档站链接分别是:
- 简体中文:https://docs.pingcap.com/zh/tidb/stable
- English:https://docs.pingcap.com/tidb/stable
- 日本語:https://docs.pingcap.com/ja/tidb/stable
其中,日本语文档站是由英文机翻的。(このページは英語版のページを機械翻訳しています。)
TiDB 文档也是开源的,中文和英文站的文档仓库分别是:
- TiDB 中文文档仓库:https://github.com/pingcap/docs-cn
- TiDB 和 TiDB Cloud 英文文档仓库:https://github.com/pingcap/docs
欢迎点个 Star 🌟

提交 PR
下面演示一下如何为 TiDB 文档提交 PR (Pull Reuest) 。
需要准备的环境有 git, vscode,注册 GitHub 账号,并 fork 文档的源码仓库。
Fork
点击仓库右上角的 Fork 按钮,或直接点击这里 Fork ,等待 Fork 完成即可。

Fork 完成后,会在自己的用户下出现一个源码仓,这里看到已经 Fork 完成,并且是最新版本。

Clone
打开 VS Code,源码控制,登录 GitHub 账户,如果浏览器已经登陆,点击【Clone from GitHub】会自动登录。

登录后,输入【username/docs-cn】。

Branch
克隆代码后,创建一个新分支,用于修改、维护,这里命名为【br-1st-pr】。

Modify
找到需要修改的文件,按需修改后提交。
关于如何找到文件所在路径的问题,我们在查阅文档时,右上角有个【文档反馈】的链接,点击后会提示文件所在路径。
例如,我想修改 【TiDB 7.5.0 Release Notes】 页面,点击右上角【文档反馈】,

将会跳转到【pingcap/docs-cn】的 Issues 页面,并给出了源码路径。

修改后,Source Control 会提示 Changes ,Commit 后会先提交到本地,

还需要 Push 到远程。

PR
Push 成功后,可以在 GitHub 上看到修改后的内容,

并提示进行【Compare & pull request】。

CLA
需要注意的是,首次在本仓库提 PR 时,请务必签署 Contributor License Agreement (CLA),否则我们将无法合并你的 PR。成功签署 CLA 后,可继续进行后续操作。

Merge
提交 PR 后,贵司会有同学定期来进行 Review 和 Approve,静待 Merge 就好。
Done
恭喜你,到此已经基本了解如何对 TiDB 文档进行修改和提 PR 了,欢迎参与 2024 TiDB Docs Dash 活动。
番外篇
搜了下记录,2022、2023年给 TiDB 文档提了若干 Issue & PR,希望在正确的道路上继续飞驰。

Ref
更多内容请参考: TiDB 中文文档贡献指南
(2024-01-01, 2024 年第 001 篇原创文章)

- Title: 如何为 TiDB 文档提交第一个 PR
- Author: ShawnYan
- Created at: 2024-01-01 10:26:16
- Updated at: 2024-01-01 10:26:16
- Link: https://shawnyan.cn/2024/tidb/tidb-docs-1st-pr/
- License: This work is licensed under CC BY-NC-SA 4.0.