首页 > 解决方案 > 将代码推送到谷歌源代码库错误

问题描述

将更改推送到我的云源存储库时出现以下错误。

remote: INVALID_ARGUMENT: Request contains an invalid argument.
remote: [type.googleapis.com/google.rpc.LocalizedMessage]
remote: locale: "en-US"
remote: message: "Invalid authentication credentials. Please generate a new identifier: https://source.developers.google.com/new-password"      
remote:
remote: [type.googleapis.com/google.rpc.RequestInfo]
remote: request_id: "xxxxx"
fatal: unable to access 'https://source.developers.google.com/p/xxx/repository/': The requested URL returned error: 400

然后我继续生成新密码并存储在.gitcookies文件中,但我仍然得到同样的错误。

标签: gitgoogle-cloud-platformgoogle-cloud-source-reposgoogle-source-repositories

解决方案


我通过使用Generate new identifier 链接生成一个新的 .gitcookies 标识符并在使用命令行对我的帐户进行身份验证后执行命令(示例如下)来解决这个问题。

git config --global http.cookiefile "%USERPROFILE%\.gitcookies"
powershell -noprofile -nologo -command Write-Output ...

最初是因为我看到了 powershell 并且我使用了 powershell 甚至 git bash 但它们都不起作用。

我发现对于 windows 用户,只需复制 windows 用户部分的命令并粘贴到 windows 命令行中,而不是 powershell 或 git bash。


推荐阅读