代码之家  ›  专栏  ›  技术社区  ›  4c74356b41

在发布管理器中合并分支

  •  0
  • 4c74356b41  · 技术社区  · 6 年前

    我有一个发布管理发布管道,设置如下:

    Artifacts >> Development (trigger on build success) >> Production (manual trigger after Development)
    

    我想做的是,将开发分支合并到master上,从开发升级到master,所以master总是有生产版本代码,但是发布代理不拉git repo,也不能访问git。我找到了 this 这表明这是不可能的(至少没有黑客)。感谢任何指点。

    我使用的是github.com,而不是vsts存储库。

    1 回复  |  直到 6 年前
        1
  •  0
  •   Marina Liu    6 年前

    要将开发分支合并到VSTS发布环境中的主分支中,可以通过添加 PowerShell任务 . 详情如下:

    使用脚本添加PowerShell任务:

    git clone https://username:password@github.com/username/repo repo
    cd repo
    git checkout development
    git checkout master
    git merge development 
    git push origin master
    

    注:

    • 应在PowerShell任务中取消选择“标准错误失败”选项。

      enter image description here

    • 如果合并期间发生合并冲突,PowerShell任务将失败。 development 分支到 master 分支。所以你最好加上 -X 选择 git merge 命令:

      git merge development -X theirs  #Resolve the merge conflict files by keeping the version on development branch
      git merge development -X ours    #Resolve the merge conflict files by keeping the version on master branch