由于某些……世界事件,我必须在公司代理之外远程工作。我已取消所有地方的代理设置,除 Git 外,一切正常。当我尝试拉取或推送到我们的 AWS CodeCommit 存储库时,我收到以下信息:
nc: getaddrinfo for host "proxy.xxxxxxxxx.net" port 8080: Name or service not known
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
这是我的 git 配置文件:
[user]
name = Me
email = [email protected]
[credential]
helper = !aws codecommit --profile default credential-helper $@
UseHttpPath = true
SSH config
#ProxyCommand nc -X connect -x proxy.xxxxxxxxx.net:8080 %h %p
IdentityFile ~/.ssh/id_rsa
User=AWSUSER
HostName git-codecommit.eu-west-1.amazonaws.com
如您所见,我已注释掉代理命令。如果我取消注释并更改端口,git 将因新端口而失败。因此,我似乎可以在这里进行一些配置。
然后我看到了这个帖子如何删除 git 的 http 代理?
然后我就跑了
git config -l
打印:
url.git://git.global.x.net:9420/repo.git.insteadof=https://gerrit.googlesource.com/git-repo
url.git://git.global.x.net:9420/repo.git.insteadof=https://android.googlesource.com/tools/repo
url.ssh://git.global.x.net/.insteadof=git://android.git.kernel.org/
url.ssh://git.global.x.net/.insteadof=git://codeaurora.org/
url.ssh://git.global.x.net/.insteadof=https://android.x.com/
url.ssh://git.global.x.net/.insteadof=git://git.global.x.net/
filter.lfs.clean=git lfs clean %f
filter.lfs.smudge=git lfs smudge %f
filter.lfs.required=true
user.name=me
[email protected]
credential.helper=!aws codecommit --profile default credential-helper $@
credential.usehttppath=true
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=ssh://dev/v1/repos/projects
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.staging.remote=origin
branch.staging.merge=refs/heads/staging
branch.develop.remote=origin
branch.develop.merge=refs/heads/develop
一开始,当我看到这些替换项时,我很兴奋,但我意识到它们都不符合 git 尝试连接的代理。清除这些设置git config --global --unset http.proxy
似乎没有任何效果。
我可以以某种方式清除 Git 中的所有代理设置吗?