【问题标题】:how to merge from feature branch to the master branch using bitbucket-pipeline.yml file?如何使用 bitbucket-pipeline.yml 文件从功能分支合并到主分支?
【发布时间】:2018-10-13 14:31:27
【问题描述】:

使用功能分支工作时,如何配置我的 bitbucket-pipeline.yml 文件以使更改自动合并到主分支?

【问题讨论】:

  • 请在标签中指定您正在使用的 SCM 系统

标签: version-control bitbucket-pipelines bitbucket-cloud


【解决方案1】:

这就是我为将分支合并到 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 所述,以克隆完整的存储库。

【讨论】:

    猜你喜欢
    • 2023-01-30
    • 1970-01-01
    • 2017-07-13
    • 2022-01-02
    • 1970-01-01
    • 2016-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多