向谷歌源代码仓库推送代码出错

6

当我推送更改到我的云源代码库时,我遇到了以下错误:

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 文件,但仍然遇到了相同的错误。

1个回答

3
我通过使用生成新标识符链接生成了一个新的.gitcookies标识符,并在使用命令行进行身份验证后执行了以下命令(示例如下),以此解决了这个问题。请注意,要保留HTML标签。
git config --global http.cookiefile "%USERPROFILE%\.gitcookies"
powershell -noprofile -nologo -command Write-Output ...

最初我使用了PowerShell和Git Bash,但它们都无法正常工作。

后来我发现,对于Windows用户,只需复制Windows用户部分的命令并粘贴到Windows命令行中,而不是PowerShell或Git Bash中。


你在哪里找到Windows用户部分?我也想看看那里发生了什么,因为你的答案不合理,对我也没有用。 - SeriousLee
在 GCP 源代码仓库上创建一个仓库后,您应该会被引导到包含如何克隆您的仓库的信息的页面。阅读具有该信息的部分,您应该会看到一个显示 Windows 信息的部分。 - Lance Armah-Abraham

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接