很多人在window使用Git版本控制的时候会用到TortoiseGit的时候会遇到拉取失败,报错如下

git.exe pull --progress -v --no-rebase "origin"
/usr/bin/bash: git@gitee.com: No such file or directory
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git 未能顺利结束 (退出码 1) (514 ms @ 2020/7/28 22:25:54)

网上很多“终极教程”最优解决方案是使用Git clone命令把远程库克隆到本地后才能解决,其实这不是最优的解决方案。

遇到这个问题是因为在配置远程库地址的时候将链接配置成了SSH链接,而windows系统默认是不支持SSH链接方式的,如果是git命令行环境下是没有问题的。

最简单的解决方法就是把远程库url改成https链接就可以了,如下图所示:

使用TortoiseGit拉取失败git.exe pull --progress -v --no-rebase "origin"的解决办法

修改完链接应用,确定,再拉取就可以完美解决。

注:SSH链接一般形式为git@gitee.com:shisou/shisou.git

      https链接一般形式为https://gitee.com/shisou/shisou.git

标签:石家庄小程序开发 TortoiseGit Git 版本控制 SSH https