Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 在Mac OS上设置GIT以使用Google代码_Macos_Git_Google Code - Fatal编程技术网

Macos 在Mac OS上设置GIT以使用Google代码

Macos 在Mac OS上设置GIT以使用Google代码,macos,git,google-code,Macos,Git,Google Code,当我试图从MacOS外壳中推送存储库时,我遇到了这个错误 致命:远程错误:无效的用户名/密码。 您可能需要使用生成的googlecode.com密码;看 我应该如何为其提供正确的密码?它应该在您的~/.netrc文件中获取您的凭据,该文件应包括: machine code.google.com login your_CodeGoogleCom_Login password your_CodeGoogle_password (和chmod go=~/.netrc) 确保: git confi

当我试图从MacOS外壳中推送存储库时,我遇到了这个错误

致命:远程错误:无效的用户名/密码。 您可能需要使用生成的googlecode.com密码;看


我应该如何为其提供正确的密码?

它应该在您的
~/.netrc
文件中获取您的凭据,该文件应包括:

machine code.google.com 
login your_CodeGoogleCom_Login 
password your_CodeGoogle_password
(和
chmod go=~/.netrc

确保:

git config --global user.name "google.username"
git config --global user.email "google.username@gmail.com"
git remote set-url origin https://code.google.com/p/projectname

(避免使用类似
https://google.username@code.google.com/p/projectname
当您使用
.netrc
文件获取凭据时)

我这样做了,但实际上它似乎被忽略了git@lowcoupling
git remote-v
返回什么?@lowcoupling因此,如果它是一个http url,其中包含
code.google.com
,它应该考虑
~/.netrc
。@lowcoupling是您的url,如:
https://username@code.google.com/…
?因为如果是,您可以尝试使用
https://code.google.com/...
。请看我编辑的答案。我想这是因为url中的用户名。非常感谢。