将远程 URL 从 SSH 切换到 HTTPS 解决git kex_exchange_identification: Connection closed by remote host

 

git clone 时选择的是SSH链接,使用HTTPS链接地址进行下载就可以啦!

 

 

 

 

更改url

将远程 URL 从 SSH 切换到 HTTPS

  1. 打开 Git Bash。
  2. 将当前工作目录更改为您的本地仓库。
  3. 列出现有远程仓库以获取要更改的远程仓库的名称。
    $ git remote -v
    > origin  git@github.com:USERNAME/REPOSITORY.git (fetch)
    > origin  git@github.com:USERNAME/REPOSITORY.git (push)
  4. 使用 git remote set-url 命令将远程的 URL 从 SSH 更改为 HTTPS。
    $ git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
  5. 验证远程 URL 是否已更改。
    $ git remote -v
    # Verify new remote URL
    > origin  https://github.com/USERNAME/REPOSITORY.git (fetch)
    > origin  https://github.com/USERNAME/REPOSITORY.git (push)

 

posted on   tycoon3  阅读(632)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 三行代码完成国际化适配,妙~啊~
· .NET Core 中如何实现缓存的预热?
历史上的今天:
2021-03-31 C++11新特性之十:enable_shared_from_this
2021-03-31 c++11 atomic
2021-03-31 How to Write a QUIC Endpoint Program
2021-03-31 Write your own QUIC application
2021-03-31 vcxproj2cmake
2021-03-31 Tars在鲲鹏ARM64服务器上的移植分享
2021-03-31 arm64 posix_quic

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示