git push cloud显示无效的身份验证凭据错误

时间:2018-03-25 08:26:46

标签: git google-cloud-platform cloud

我想将应用程序推送到Google云存储库

我为git添加了这样的远程存储库:

git remote add cloud  https://source.developers.google.com/p/abc/r/xxxxx

然后我做了一个提交并执行了git push cloud,但发现了以下错误:

fatal: remote error:


Invalid authentication credentials.

    Please generate a new identifier:
      https://source.developers.google.com/new-password

点击链接并在google中验证也无法正常工作。

查询:

如何推进谷歌云?

2 个答案:

答案 0 :(得分:1)

current credential manager中确认我的凭据(感谢VonC's answer的链接)之后,对我有用的是首先在另一个文件夹中检出空存储库

gcloud source repos clone <repo> --project=<project>

这将发出警告,因为存储库为空

warning: You appear to have cloned an empty repository.

然后我将代码添加到此文件夹,在git上本地提交,然后再次尝试git push

cd <folder>
# git add <...>
# git commit <...>
git push -u origin master

编辑:此答案假定您已经安装并初始化了Google Cloud SDK

答案 1 :(得分:0)

确保您已定义right credential helper

git config credential.helper gcloud.sh

# Or, on Windows:

git config credential.helper gcloud.cmd

这样,您就不会使用可能已在current credential manager, as in here中缓存的错误凭据。

并确保您拥有远程仓库。

相关问题