非常奇怪,但我无法向Github提交任何存储库(包括新的存储库)。
我已经将我的SSH密钥上传到Github。
demas@demas-home:~/dotfiles$ ssh -T git@github.com
Warning: Permanently added the RSA host key for IP address '192.30.252.130' to the list of known hosts.
嗨,德马斯!您已成功进行身份验证,但GitHub不提供shell访问。
现在我创建了一个新的存储库并尝试将第一个提交推送到GitHub:
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/demas/netrunner.git
git push -u origin master
但是GitHub要求输入我的用户名和密码。为什么?
即使我输入了我的用户名和密码,我还是会收到错误提示:
demas@demas-home:~/netrunner$ git push -u origin master
Username for 'https://github.com': demas
Password for 'https://demas@github.com':
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/demas/netrunner.git/'
如果有必要,我会使用双重身份验证。