在使用git pull时身份验证失败。

4

我正在尝试从Google云存储库将远程存储库克隆到本地存储库。我的系统是Kubuntu 14.04。

首先,我使用以下命令创建了一个空的本地git存储库:

git init test

然后我尝试使用以下命令:

cd test
git pull https://source.developers.google.com/p/{project_id}
Username for 'https://source.developers.google.com': #########
Password for 'https://########@source.developers.google.com': 

但是我遇到了以下错误:
致命错误:对于 https://source.developers.google.com/p/{project_id}/,身份验证失败。
我的用户名和密码是正确的,我已经尝试在 SO 上寻找解决方案,但它是关于 GitHub 而不是 Google 云存储库。
非常感谢您的帮助。

2
文档中提到,您必须安装一个 credential.helper 才能使用存储库:https://cloud.google.com/tools/cloud-repositories/docs/cloud-repositories-local-repository 您是否已经安装了它? - eckes
1
@eckes 我已经跟随那个链接并尝试了这个命令:'git config credential.helper gcloud.sh',之后它就可以工作了。非常感谢你。 - Rajesh Jadav
1个回答

4

你可以尝试使用 git remote update 命令:将远程分支更新到本地。 - Anurag
1
虽然这个链接可能回答了问题,但最好在此处包含答案的基本部分并提供参考链接。如果链接页面更改,仅链接的答案可能会失效。-【来自审查】 - bfontaine
1
@bfontaine 我不同意这是一个仅包含链接的答案。这里以命令的形式给出了“必要部分”。 - Barett
@Barett 我同意你的观点。 - Rajesh Jadav

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