Private GitHub repository in rust project

how to use my own private GitHub repository in rust cargo

You have two options:

  1. Use a git submodule and cratename = { path = "./path-to-submodule" }

  2. Add required SSH keys to ssh-agent. Then create .cargo/config with

    [net]
    git-fetch-with-cli = true
    

    and add dep as cratename = { git = "ssh://git url here" }

1 Like

You'll typically only need to mess with ssh-agent if you don't enable git-fetch-with-cli.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.