gitsshgoogle-cloud-repository

Trying to clone repo from Google Cloud Source Repositories using SSH authentication


I am trying to clone an empty repository from the Google Cloud Resource Repositories. So far I have:

However, it fails with this response:

Cloning into 'some-repository'...
Enter passphrase for key '/c/Users/blah/.ssh/id_rsa':
fatal: could not fetch refs from ssh://blah@gmail.com@source.developers.google.com:2022/p/some-project/r/some-repository

I am running Git Bash from Windows 10

It does label SSH Authentication as BETA on Cloud Resource Repositories, which makes me wonder if it might not be fully functional yet.
Has anyone managed to connect to Cloud Resource Repositories via SSH?

Any help or advice much appreciated. Thank you


Solution

  • Try first to use an SSH key without passphrase, and make sure to create it with the legacy format:

    ssh-keygen -m PEM -t rsa -P ""
    

    (The -m PEM is for producing the legacy format)

    That will overwrite your previous key: register the new id_rsa.pub content, and try again.