Cloud Shell克隆.NET教程代码失败的问题咨询及报错详情
解决Cloud Shell克隆.NET教程仓库失败的问题
问题原因
- 目标仓库默认分支已从
master改为main,但Cloud Shell自动执行的克隆命令仍在使用旧分支名,导致分支不存在错误。 - 自动克隆的仓库是第一个教程的项目,与当前Firestore会话处理教程不匹配。
解决步骤
- 清理旧的无效克隆目录:
rm -rf /home/kramffud/cloudshell_open/getting-started-dotnet - 手动克隆正确的仓库(使用
main分支):git clone -b main https://github.com/GoogleCloudPlatform/getting-started-dotnet.git /home/kramffud/cloudshell_open/getting-started-dotnet - 进入项目目录继续后续操作:
cd /home/kramffud/cloudshell_open/getting-started-dotnet - 关联你的实际项目“My Bookstore”:
gcloud config set project "My Bookstore"
内容的提问来源于stack exchange,提问作者KramFfud
相关产品推荐
相关产品推荐

