将代码推送到谷歌源存储库错误

Lan*_*ham 7 git google-cloud-platform google-cloud-source-repos google-source-repositories

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

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
Run Code Online (Sandbox Code Playgroud)

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

Lan*_*ham 4

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

git config --global http.cookiefile "%USERPROFILE%\.gitcookies"
powershell -noprofile -nologo -command Write-Output ...
Run Code Online (Sandbox Code Playgroud)

最初因为我看到了powershell,所以我使用了powershell,甚至git bash,但它们都不起作用。

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