Forums

How to clone private github repos to Pythonanywhere?

Hi all!

I'm looking to clone a private repository onto Python anywhere. I don't fully understand the bash terminal and what is connected to it (windows user, just getting into learning hosting, don't know much about how this environment works... also side note pipenv doesn't work by default here

You use git clone command and you need to have your git configured with some credentials.

My repository is private as well. To access it, you'll need to generate SSH keys using the PythonAnywhere bash console. Then, add the generated public key to your GitHub SSH keys. Once completed, you'll be able to clone your repository.

Search for "How to create and configure an SSH Key for GitHub" on YouTube. You'll find numerous tutorials covering this topic

@yeiyeh, thanks for sharing the solution!

Hi there,

I'm unable to pull from my repo. I've tried creating several key pairs, both on my local machine and on the bash console. I'm able to clone successfully from my local machine, but not from the bash console. I'm currently using the free version, so I don't know if that matters.

I'm getting the standard error back, but the SHA256 fingerprint seems to be the same regardless of whatever keypair I use:

The authenticity of host 'github.com (140.82.114.4)' can't be established.
ECDSA key fingerprint is SHA256:<Same SHA256 for all generated keypairs
Are you sure you want to continue connecting (yes/no/[fingerprint])? 
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

It's not about your key, it's about a github host key that you need to trust. It should match https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints

Thanks! Also, I realized that simply answering "yes" to the "Are you sure..." question works. For some reason, I thought that accepting the default via Enter worked, but I guess I was wrong.

Glad you got that working!