Gitee 的宝藏功能:推送到特定分支可以自动创建代码合并请求

查看 59|回复 1
作者:sadhen   
这是该功能的 Gitee 官方文档: https://gitee.com/help/articles/4346
为什么我说这是一个宝藏功能
以我的代码项目 mogan 为例
首先申明一下,我用的 remote 不是 origin 而是 gitee:
git remote add gitee [email protected]:XmacsLabs/mogan.git
这是我刚刚提交的代码,以及 Push 到 Gitee 的命令行:
$ git checkout -b da/gitee_workflow
# 开始写文档并提交代码
$ git push gitee da/gitee_workflow:main
枚举对象中: 19, 完成.
对象计数中: 100% (19/19), 完成.
使用 12 个线程进行压缩压缩对象中: 100% (12/12), 完成.
写入对象中: 100% (14/14), 2.70 KiB | 2.70 MiB/s, 完成.
总共 14 (差异 8 ),复用 0 (差异 0 ),包复用 0
remote: Powered by GITEE.COM [GNK-6.4]
remote: You cannot push to a protected branch 'main' directly
remote: we've created a Pull Request for code review (main -> auto-5491342-main-014c7da1)
remote: Please visit the URL:
remote: https://gitee.com/XmacsLabs/mogan/pulls/45
To gitee.com:XmacsLabs/mogan.git
   29dd493..1c8beec  da/gitee_workflow -> auto-5491342-main-014c7da1
这是 Gitee 自动生成的代码合并请求: https://gitee.com/XmacsLabs/mogan/pulls/45
不知道这个是不是 Gitee 原创的功能,Github 是否有类似的功能?
对于非代码项目
我一直在筹备的这个用 Git 工作流维护的百科项目:
https://gitee.com/XmacsLabs/tmmlwiki
它的目标用户是那些不太会用 Git 的用户,我觉得 Gitee 这个小创新能够帮助这些用户完成第一个 Pull Request 。
比如:
git clone https://gitee.com/XmacsLabs/tmmlwiki.git
cd tmmlwiki
# 改一下里面的词条
git push origin main
这就就完成了一个词条的编辑!

gitee, git, Remote, 代码

lcdtyph   
gerrit-git 的功能
您需要登录后才可以回帖 登录 | 立即注册

返回顶部