IntelliJ 中 Git 报错 Could not read from remote repository

背景

使用 IntelliJ 自带的 VCS -> Git -> Pull/Push 突然不 work 了。

P1

错误信息

切到 Git console 看,错误信息如下:

com.trilead.ssh2.HTTPProxyException: HTTP Proxy Error (403 Forbidden)
	at com.trilead.ssh2.transport.TransportManager.establishConnection(TransportManager.java:432)
	at com.trilead.ssh2.transport.TransportManager.initialize(TransportManager.java:459)
	at com.trilead.ssh2.Connection.connect(Connection.java:757)
	at com.trilead.ssh2.Connection.connect(Connection.java:686)
	at com.trilead.ssh2.Connection.connect(Connection.java:600)
	at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:173)
	at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:137)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

分析

尝试其他 Git 工具,Source Tree 是工作的,Git Cmd 也是工作的。

经过一番探索,终于搞定了。

解决:在 IntelliJ 的 Git 配置中,使用 Native 的 SSH ,而不是 Build-in
( Native 的 SSH ,也是 Git Cmd 使用的那个,之前说过了是工作的,且我特意确认了一下它指向的 SSH key 也是对的 )

P2

原因:再次甩锅给IT,周末例行维护升级电脑,我周一回来发现 IntelliJ 的某些功能就不工作了。

原文地址:https://www.cnblogs.com/maxstack/p/14695692.html