git - 如何将 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
有什么帮助吗?
解决方案
推荐阅读
- python-poetry - 从 codeartifact 安装带有诗歌的库,而不需要从那里移动所有要安装的库
- r - lm R 的汇总输出精度
- c++ - 寻求关于 std::cout 和 std::endl 的澄清
- html - 如何使用 CSS 选择父元素的兄弟?
- ios - 应用程序跟踪透明度弹出窗口是否在 webview 中提供第三方 cookie 访问权限?
- nginx - 使用 nginx 反向代理访问所有路径
- python - Python Popen + ffmpeg
- java - 当我们将 Flink 应用程序部署到 Kinesis Data Analytics 中时,不会触发窗口化
- bash - 在 openvpn 之后运行脚本
- java - 当我切换标签时,片段布局将始终保持不变