Git的推动需要用户名和密码 [英] Git push requires username and password
问题描述
我克隆一个Git仓库从我Github上的帐户,以我的电脑。
I cloned a git repository from my Github account to my PC.
我要和我的两个PC和笔记本电脑的工作,但有一个Github上的帐户。
I want to work with both my PC and laptop, but with one Github account.
当我尝试推到或使用我的电脑从GitHub拉,它需要用户名和密码,但不使用笔记本电脑的时候!
When I try to push to or pull from Github using my PC, it requires username and password, but not when using the laptop!
我不希望我每次与原籍互动时输入自己的用户名和密码。
我是缺少在这里?
I don't want to type my username and password every time I interact with origin. What I am missing here?
推荐答案
一个常见的错误是使用SSH而不是默认的(HTTPS)克隆。您可以通过你的资料库,点击左边的URL字段中的ssh键和远程更新来源的URL像这样纠正这个:
A common mistake is cloning using the default (HTTPS) instead of SSH. You can correct this by going to your repository, clicking the ssh button left to the URL field and updating the URL of your origin remote like this:
git remote set-url origin git@github.com:username/repo.git
这篇关于Git的推动需要用户名和密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!