【发布时间】:2021-07-28 08:48:19
【问题描述】:
这里是超级基本的问题,但我一直无法找到有相同问题的论坛。我正在尝试将我的本地 git 存储库从 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 origin git@github.com:USERNAME/REPOSITORY.git
$ git remote -v
> origin git@github.com:USERNAME/REPOSITORY.git (fetch)
> origin git@github.com:USERNAME/REPOSITORY.git (push)
这对我来说是这样的:
E:\Example>git remote -v
origin https://github.com/Kornosky/RotaryAnimation.git (fetch)
origin https://github.com/Kornosky/RotaryAnimation.git (push)
E:\Example>git remote set-url origin git@github.com:Kornosky/RotaryAnimation.git
E:\Example>git remote -v
origin https://github.com/Kornosky/RotaryAnimation.git (fetch)
origin https://github.com/Kornosky/RotaryAnimation.git (push)
无论我运行什么命令,我都无法将其更改为 SSH。此外,我已经从 git 配置文件中删除了所有信息,并且我已经运行了这个命令并且很多人都喜欢它:
git config --global url.ssh://git@github.com/.insteadOf https://github.com/
有什么建议吗?我一直用这个把头发拉出来。最终目标是解决我的推送挂起的问题。我试图通过更改 HTTPS 设置来诊断,但没有运气让我的文件推送(没有文件甚至接近 100MB 的单个文件限制)。
编辑:即使我尝试创建新的存储库,我似乎也无法切换到 SSH。也许这可能是一个帐户设置?
【问题讨论】:
标签: git github ssh https git-remote