如何在Ubuntu上对Github进行身份验证? git:"credential-netrc"不是git命令
问题描述:
I read this and I have checked my credentials,still I can not git push.
git push --set-upstream origin master
git: 'credential-netrc' is not a git command. See 'git --help'.
到目前为止我所做的:
- 创建〜/.netrc
-
gpg --gen-key
-
gpg -e -r myemail@gmail.com ~/.netrc
- 通过应对添加了创建助手Perl回购到
~/.local/bin/git-credential-netrc
- 设置Git
- Created ~/.netrc
gpg --gen-key
gpg -e -r myemail@gmail.com ~/.netrc
- Added creation helper by coping Perl repo to
~/.local/bin/git-credential-netrc
- Set up Git
git config --global credential.helper"netrc -f〜/.netrc.gpg -v"
git config --global credential.helper "netrc -f ~/.netrc.gpg -v"
答
您需要确保:
-
~/.local/bin/
在您的$ PATH中 -
git-credential-netrc
是可执行的(chmod 755 ~/.local/bin/git-credential-netrc
)
-
~/.local/bin/
is in your $PATH -
git-credential-netrc
is executable (chmod 755 ~/.local/bin/git-credential-netrc
)
然后,您可以测试git credential-netrc
(注意空格)是否会响应任何内容(即使出现错误)
Then you can test if git credential-netrc
(note the space) will respond anything (even if it errors)