Chr*_*sky 5 git ssh https github git-remote
这里是超级基本问题,但我找不到有同样问题的论坛。我正在尝试将本地 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)
Run Code Online (Sandbox Code Playgroud)
这对我来说是这样的:
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)
Run Code Online (Sandbox Code Playgroud)
无论我运行什么命令,我都无法将其更改为 SSH。此外,我已经从 git config 文件中删除了所有信息,并且运行了此命令以及许多类似的命令:
git config --global url.ssh://git@github.com/.insteadOf https://github.com/
Run Code Online (Sandbox Code Playgroud)
有什么建议么?我一直在用这个把头发拔出来。最终目标是解决我的推送挂起的问题。我尝试通过更改 HTTPS 设置来进行诊断,但没有成功推送我的文件(没有文件甚至接近 100MB 的单个文件限制)。
编辑:即使我尝试创建新的存储库,我似乎也无法切换到 SSH。也许这可能是一个帐户设置?
小智 0
我能够使用提供的命令成功更新我的远程 URL。
我认为您需要将您的用户名(Kornosky)和存储库(RotaryAnimation)名称放入set-url
命令中:
git remote set-url origin git@github.com:Kornosky/RotaryAnimation.git
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1758 次 |
最近记录: |