如何将已存在仓库从ssh改为https

2022/10/15 Git

# 问题

kex_exchange_identification: read: Connection reset by peer Connection reset by xxxx port 22

# 操作

  • 查看git当前地址
    git remote -v
    #origin https://github.com/xxx/xxx.git (fetch)
    #origin https://github.com/xxx/xxx.git (push)
    
    1
    2
    3
  • 然后使用命令** git remote set-url** 来调整你的url
    git remote set-url origin git@github.com:someaccount/someproject.git
    # git remote set-url origin 
    
    1
    2
  • 第一次连接
      //第一次连接
      $ git remote add origin git@gitee.com:qiphon/music-thumb.git
      $ git push -u origin master
    
    1
    2
    3
  • 然后你可以再用命令 git remote -v 查看一下,url是否已经变成了ssh地址
最后更新时间: 2023/1/12 15:59:09