简体   繁体   English

PyCharm IDE 连接到 GitHub 存储库

[英]PyCharm IDE Connecting to GitHub Repo

I am trying to Push some codes into GitHub's Repo, but after following PyCharm's Documentation to set the Remotes ,Setting Directory to Repo, and setting the ssh executable to "Built-In" (on Version Control Settings), I got the following error:我正在尝试将一些代码推送到 GitHub 的 Repo,但是在按照 PyCharm 的文档设置Remotes 、将目录设置为 Repo 并将ssh 可执行文件设置为“内置” (在版本控制设置上)之后,我收到以下错误:

  dnb_api: ssh: Could not resolve hostname github.com: Name or service not known Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

the weird thing is: the repo actually exists and the link to connect is in SSH form: "git@github.com:user/repo.git"奇怪的是:repo 确实存在,并且连接的链接是 SSH 形式:“git@github.com:user/repo.git”

It's important to note that I'm under a corporate proxy, but all proxy settings are properly configured (since I can install packages and connect with external APIs).需要注意的是,我使用的是公司代理,但所有代理设置都已正确配置(因为我可以安装软件包并与外部 API 连接)。 Even the即便是

  'git config --global http.proxy <username>:<password>@proxy:port' 

and

  'git config --global https.proxy <username>:<password>@proxy:port'

where properly configured in the command line.在命令行中正确配置的地方。

Do you have an idea how to figure that out?你知道如何解决这个问题吗?

First, SSH would not need to proxy to be set: said proxy would be for HTTPS connections.首先,SSH 不需要设置代理:所述代理将用于 HTTPS 连接。

Second, double-check in command-line that ssh -Tv git@github.com does work (see "Testing your SSH connection ": so you see a welcome message?).其次,在命令行中仔细检查ssh -Tv git@github.com是否有效(请参阅“测试您的 SSH 连接”:所以您会看到欢迎消息?)。
Any mission I have done with corporate client has always involved SSH being blocked by the client proxy.我对企业客户端所做的任何任务都涉及到 SSH 被客户端代理阻止

The OP Petter Mendes indicates: OP Petter Mendes指出:

I updated Windows Credentialswith Git's token and now it's working....我用 Git 的令牌更新了 Windows Credentials,现在它正在工作......

That means:这意味着:

  • the URL was an HTTPS one, not an SSH one URL 是 HTTPS 的,而不是 SSH 的
  • the GitHub account had 2FA activated, in which case only a token works as a password. GitHub 帐户激活了 2FA,在这种情况下,只有令牌用作密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM