简体   繁体   English

如何在github中使用ssh,似乎它本身全部切换为https?

[英]How to use ssh with github, it seems it's switching to https all by itself?

I cloned a repo using the "ssh" method, but then, there is a the https method in remote, and git push is asking password ?? 我使用“ ssh”方法克隆了一个存储库,但是远程有一个https方法,而git push要求输入密码?

git clone git@github.com:julienfr112/random.git
cd random
git remote -v
 origin https://github.com/julienfr112/random.git (fetch) origin https://github.com/julienfr112/random.git (push) 
cat .git/config
 [remote "origin"] url = git@github.com:julienfr112/random.git fetch = +refs/heads/*:refs/remotes/origin/* 

What the heck ? 有没有搞错 ?

Have you added the SSH Key to your github account??? 您是否已将SSH密钥添加到github帐户中???

If yes, then try setting the remote origin using the following command: 如果是,则尝试使用以下命令设置远程原点:

git remote set-url origin git@github.com: USERNAME / REPOSITORY .git git remote set-url origin git@github.com: USERNAME / REPOSITORY .git

If no, you need to add the SSH key to your account first and then try... 如果不是,则需要先将SSH密钥添加到您的帐户,然后尝试...

Hope it helps... 希望能帮助到你...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM