idea使用git连接时(pull,push)报错:Could not read from remote repository
但是git Bash可以提交
经过10分钟的检查后发现是地址类型的问题
http://jiong@127.0.0.1:12345/r/code/wawu.git //idea可以连接
ssh://jiong@127.0.0.1:12345/code/wawu.git //idea不能连接
这里记录一下更换git远程连接地址的方法
git remote -v //查看远程仓库信息
git remote remove origin //移除名为origind的本地远程仓库信息
git remote add origin http://jiong@127.0.0.1:12345/r/code/wawu.git //添加远程仓库地址
我这种情况改了之后就可以提交了
不过在提交是要填写远程仓库名称和分支名,如:
git pull origin master
为了不输入后面的名称和分支名,这里记录一下设置默认远程名称和分支名的方法
git branch --set-upstream-to=origin/master
//git branch --set-upstream-to=[远程仓库名称]/[远程仓库分支名称]
本文详细记录了解决IDEA中使用Git时遇到的“Could not read from remote repository”错误的过程。通过更改远程仓库地址从SSH到HTTP,成功解决了IDEA无法连接的问题,并分享了如何设置默认远程名称和分支名。
2234

被折叠的 条评论
为什么被折叠?



