Git 在发布管理器中合并分支

Git 在发布管理器中合并分支,git,continuous-integration,azure-devops,azure-pipelines-release-pipeline,Git,Continuous Integration,Azure Devops,Azure Pipelines Release Pipeline,我有一个发布管理发布管道,其设置如下: Artifacts >> Development (trigger on build success) >> Production (manual trigger after Development) 我想做的是,将开发分支合并到Master中,从开发到Master进行升级,这样Master总是有生产版本代码,但发布代理不拉git repo,也不能访问git。我发现这表明这是不可能的(至少没有黑客)。欢迎指点 我使用的是githu

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

Artifacts >> Development (trigger on build success) >> Production (manual trigger after Development)
我想做的是,将开发分支合并到Master中,从开发到Master进行升级,这样Master总是有生产版本代码,但发布代理不拉git repo,也不能访问git。我发现这表明这是不可能的(至少没有黑客)。欢迎指点


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

要在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任务中取消选择标准错误失败选项

  • 如果在将
    开发
    分支合并到
    分支期间存在合并冲突,则PowerShell任务将失败。因此,您最好为
    git merge
    命令添加
    -X
    选项:

    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
    

是的,这是很明显的,但这是一种黑客行为,我说的是一种正确的方法,你的意思是通过VSTS发布管理自动将开发分支合并到主分支中吗?正如您在用户语音中发现的,合并操作需要由用户自定义(而不是由VST本身)