Is it possible to have Cargo fetch dependencies from a private remote git?

后端 未结 2 728
我寻月下人不归
我寻月下人不归 2021-02-07 08:09

I have an account on an ssh-friendly lab machine where I store a lot of private projects so I can access them from multiple computers (and it allows me to only use my few privat

相关标签:
2条回答
  • 2021-02-07 08:35

    Use a full SSH path rather than Git’s shorthand:

    git = "ssh://landmachine/bar/foo"
    
    0 讨论(0)
  • 2021-02-07 08:41

    On macOS Sierra, I had to create a .ssh/config file like this:

    Host *
       UseKeychain yes
       AddKeysToAgent yes
       IdentityFile ~/.ssh/id_rsa
    

    with the private key (RSA) file pointed to, and then issue the command:

    ssh-add -K ~/.ssh/id_rsa
    

    which (finally!) allowed an entry like:

    git = "ssh://git@github.com/skipjaq/loda.git"
    

    to work perfectly.

    I do not know how often I will have to repeat the ssh-add command, but it appears this ought to hold at least until the next reboot.

    This anomaly is apparently a feature of ssh-agent on macOS Sierra.

    0 讨论(0)
提交回复
热议问题