git - 如何使用 Azure CLI 创建 Azure DevOps 存储库

标签 git azure azure-devops azure-cli

遵循文档 here ,我尝试使用以下命令创建存储库:
az repos create --name 示例

返回以下错误:

The command failed with an unexpected error. Here is the traceback:

TF401019: The Git repository with name or identifier client does not exist or you do not have permissions for the operation you are attempting. Operation returned an invalid status code of 404.

我已运行 az login 命令,并使用以下命令将组织和项目设置为配置中的默认值:
az devops configure --defaultsorganization=https://dev.azure.com/exampleproject=example

如何使用 Azure DevOps CLI 创建存储库?

最佳答案

been seen here对于 accounts using 2FA

I tried something else - I did not delete the Git credentials, but I chose the option to modify them and I used login/password I generated as alias to my primary username (the one I used in the cli).
After VS restart I was able to push my changes.

This is only a workaround (my primary account still does not work in vs), but it will make my life easier for now.

另外:

I got a hint from another forum that i should try to run VS as an administrator (or as another user) and it worked.

I used the same account to authenticate in TFS, which is not working for my windows user account i normally use.

关于git - 如何使用 Azure CLI 创建 Azure DevOps 存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55896570/

相关文章:

Git stash 以修补未跟踪的文件

visual-studio - 如何重新打开 azure 部署警告模式 "deployment environment in use"?

azure - 如何使用 Azure 表存储选择 RowKey 范围?

azure - 更改 Application Insights 配置是否会触发应用程序池回收

TFS 构建将消息写入摘要

ruby-on-rails - 如何更新 Gem 上的单个提交?

linux - 将 Windows SSH 连接到 CentOS 7 for git

Azure Devops - 仅在发生更改的文件夹中运行构建

Azure Devops YAML - AzureKeyVault 任务不接受变量作为 keyvaultname

git - 在 vim 中使用 git commit -a