-
将远程 URL 从 HTTPS 切换到 SSH
-
列出现有远程仓库以获取要更改的远程仓库的名称
$ git remote -v > origin https://github.com/USERNAME/REPOSITORY.git (fetch) > origin https://github.com/USERNAME/REPOSITORY.git (push)
-
使用 git remote set-url 命令将远程的 URL 从 HTTPS 更改为 SSH
$ git remote set-url originvgit@github.com:USERNAME/REPOSITORY.git
-
验证远程 URL 是否已更改
$ git remote -v # Verify new remote URL > origin git@github.com:USERNAME/REPOSITORY.git (fetch) > origin git@github.com:USERNAME/REPOSITORY.git (push)
2021-10-15 github设置ssh密钥仍无法直接推送的解决方案
最新推荐文章于 2023-05-19 17:18:25 发布