Github private repository in platformio library manager

Hi, I’m trying and failing in configuring platformio to pull library from private Github repository.
According to this https://github.com/platformio/platformio-core/issues/537 it should be possible, but I’m still failing.
I’m using VSCode IDE on Windows 10, plus I have Git for windows and Github client installed.

  1. I have ssh-agent running with correct private key added (I tested that using git from command line)
  2. I tried several options in configuring platformio.ini
    git+ssh://git@github.com/org/repository.git
    git@github.com:org/repository.git
  3. but none of them works (I tried few more, but definitely wrong syntax) - I’m getting “permission denied (publickey)” error
  4. I copied command line from IDE error window and run it directly from CMD - it went through without any issue

Any idea on how to make it work?

All right. Found the way around it.

Solution is to forget about ssh-agent and configure ssh config file properly
Host github.com
StrictHostKeyChecking no
IdentityFile c:\Users\me\.ssh\private_key_rsa

4 Likes

This worked for me aswell, thanks a bunch!

Additional info (because this isn’t obvious for everyone):

  • Create a key pair for github in powershell with command
    ssh-keygen -t ed25519 -C "your_email@mail.com"
  • Go to your Github account settings>ssh and paste your public key (.pub)
  • Create a file in C:\Users\your_home_folder\.ssh named config (without any extension)
  • Open as text file and paste the solution from JozefS into the config file
    and change the path to your private key (the generated file with no extension)

Done.

Now use JozefS syntax in platform.ini for adding private Github repos:
git+ssh://git@github.com/your_organisation/your_repo.git