在我的GitHub帐户下的“设置”=>“SSH密钥”中为什么会显示“由GitHub for Mac添加于2014年10月24日-从未使用”?我已经在GitHub上做出了很多贡献,都是从那台机器上提交的!我还有另一把密钥,上面写得很正确,“最近一天内上次使用”。这把密钥是来自另一台机器。
git remote -v
这将列出您的远程连接
如果显示如下内容:
origin https://github.com/......
那么您是通过https连接,而不是SSH连接
您需要删除该远程连接 -
git remote rm origin
然后,在您的Github存储库页面上,请查看以下内容:
点击SSH链接,然后复制。它应该以git@github.com
开头。
然后,将其添加为远程-
git remote add origin git@github.com:.... 等等
add
、rename
、remove
、set-head
等命令。所以我就尝试了一下remove
命令。 - mikelovelyukset-url
命令来修改。https://docs.github.com/zh-cn/get-started/getting-started-with-git/managing-remote-repositories#changing-a-remote-repositorys-url - Wtower