Rust Cargo.toml: How to use git repository at specific branch

This is how to use a specific Git repository URL and branch in your Rust project’s Cargo.toml file for a dependency:

example.toml
# ...

[dependencies]
ethercat-esi = { git = "https://github.com/ulikoehler/ethercat-esi.git", branch = "Comment-Tag" }

Check out similar posts by category: Rust