git切换连接方式(ssh-https)

 

 

要将git仓库的ssh链接切换为https链接,可以按照以下步骤操作:
 
1. 打开终端,并进入到本地的git仓库目录中。
 
2. 使用以下命令查看当前git仓库的远程链接:
git remote -v
3. 使用以下命令移除当前的ssh远程链接:
git remote remove origin
4. 使用以下命令添加https远程链接:
git remote add origin https://github.com/username/repo.git
其中,`https://github.com/username/repo.git`替换为你的仓库的https链接。
 
5. 使用以下命令再次验证远程链接是否已经切换为https链接:
git remote -v
 
现在,你的git仓库的远程链接已经成功切换为https链接。你可以使用https链接进行push、pull等操作。
posted @ 2024-05-20 11:40  SimoonJia  阅读(99)  评论(0编辑  收藏  举报