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