Petter_M
Petter_M

Reputation: 465

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:

  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: "[email protected]: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). 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?

Upvotes: 1

Views: 713

Answers (1)

VonC
VonC

Reputation: 1324218

First, SSH would not need to proxy to be set: said proxy would be for HTTPS connections.

Second, double-check in command-line that ssh -Tv [email protected] does work (see "Testing your SSH connection": so you see a welcome message?).
Any mission I have done with corporate client has always involved SSH being blocked by the client proxy.

The OP Petter Mendes indicates:

I updated Windows Credentialswith Git's token and now it's working....

That means:

  • the URL was an HTTPS one, not an SSH one
  • the GitHub account had 2FA activated, in which case only a token works as a password.

Upvotes: 2

Related Questions