Since cargo support directly specify a git repository as dependency. I think specify a ref, branch, or tag for a git repository is an essential requirement.
It can indeed!
[dependencies.foo]
git = "..."
branch = "foo"
[dependencies.foo]
git = "..."
rev = "a123456"
[dependencies.foo]
git = "..."
tag = "v0.1.0"
Sorry for open this useless issue. Thanks for your reply!
@edgarwang maybe github should offer an “official questions” feature.
or alternetively questions like this should be converted to real bugs: “please document the way cargo can specify branches, tags, or revisions in a more visible way”
Tha'ts what Stack Overflow is for.
Is it possible this features only works for GitHub repositories? It fails for me on a BitBucket repository, saying something like "Unable to update https://[email protected]/someone/project.git?branch=branchname"
Edit: I probably have a proxy problem, nevermind.
The URL probably shouldn't include the branch name but rather explicitly specify it in Cargo.toml:
[dependencies]
foo = { git = "https://bitbucket.org/bar/foo", branch = "branch" }
This doesn't seem well documented on the crates website: http://doc.crates.io/manifest.html
For me, this issue is the first hit on "cargo git branch" google search keywords :)
https://www.google.ca/search?q=cargo+git+branch
The feature is talked about here http://doc.crates.io/specifying-dependencies.html#specifying-dependencies-from-git-repositories
I can't find a single mention about pinning to specific commits? Is this done with rev keyword?
@pronebird please ask questions on users.rust-lang.org
(and yes, it's rev)
Most helpful comment
It can indeed!