【发布时间】:2018-10-13 14:31:27
【问题描述】:
使用功能分支工作时,如何配置我的 bitbucket-pipeline.yml 文件以使更改自动合并到主分支?
【问题讨论】:
-
请在标签中指定您正在使用的 SCM 系统
标签: version-control bitbucket-pipelines bitbucket-cloud
使用功能分支工作时,如何配置我的 bitbucket-pipeline.yml 文件以使更改自动合并到主分支?
【问题讨论】:
标签: version-control bitbucket-pipelines bitbucket-cloud
这就是我为将分支合并到 master 中所做的工作
#fetch from all branches and mock a user to perform the merge
- git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
\ && git config user.email "git@example.com"
\ && git config user.name "git"
- git fetch origin && git checkout origin/master
- git merge $BITBUCKET_BRANCH
最后,如果要提交合并,应在脚本末尾添加git push 命令,可能使用存储库的真实帐户。
编辑
上述解决方案似乎仅在用户是存储库的所有者时才有效。
尝试使用depth 选项进行管道配置,如here 所述,以克隆完整的存储库。
【讨论】: