首页 > 解决方案 > 如何将 AzureDevops 配置为仅在代码提交中的特定分支上提交

问题描述

我在 AzureDevops 上有存储库,我将其镜像到 CodeCommit。

我现在使用的 PowerShell 脚本是:

$env:GIT_REDIRECT_STDERR = '2>&1'
git clone --mirror https://$env:SYSTEM_ACCESSTOKEN@dev.azure.com/MelonElevenPoint2/ThrottleUp/_git/ThrottleUp_Mobile
cd ThrottleUp_Mobile.git
git push --force --all https://$(user):$(pass)@git-codecommit.us-east-2.amazonaws.com/v1/repos/ThrottleUp

到目前为止,当我推动开发分支时,我在 Code Commit 上构建了完整的 repo。这需要更改,例如:在推送到开发分支时,我只需要在代码提交上构建开发分支

我创建了类似的脚本,但 id 不起作用:

$env:GIT_REDIRECT_STDERR = '2>&1'
git clone --mirror https://$env:SYSTEM_ACCESSTOKEN@dev.azure.com/MelonElevenPoint2/ThrottleUp/_git/ThrottleUp_Mobile
cd ThrottleUp_Mobile.git
git push origin develop https://$(user):$(pass)@git-codecommit.us-east-2.amazonaws.com/v1/repos/ThrottleUp

我收到这种错误:fatal: --mirror can't be combined with refspecs

有什么帮助吗?

标签: gitgithubazure-devopscontinuous-integration

解决方案


推荐阅读