On Thu, 26 May 2016 21:38:30 +1000
jupiter <jupiter....@gmail.com> wrote:

>  Thanks for the responses, I figured out that I can get a specific
> revision number based on the commit hash:
> $ git describe --tag 412dd75428226d10044e80e741addecb24dbedb5
> 2.2.0-git-7645-g412dd75
> I can clone the specific revision source from Ansible using
> --version=2.2.0-git-7645-g412dd75, but how can I clone that revision
> source from git command? It failed at following command, apparently
> git clone does not have an option --version, what is the equivalent
> option for --version?
> $ git clone --version 2.2.0-git-7645-g412dd75
> https://github.com/videolan/vlc.git
> error: unknown option `version'

Impossible with `git clone` as it's tailored for the most common case
which is "get everything".
You need a two-step operation:

  git init vlc
  cd vlc
  git fetch https://github.com/videolan/vlc.git \

This command will create a local branch "mybranch" which tip commit
will be that one identified by that SHA-1 hash.

Also note that there's no concept of "version" in Git.  Git only deals
with direct names of commits (those hashes) and "refs" -- short for
"references" -- which are branches and tags.  Those are named
references to commits so, in effect, they are merely human-friendly
aliases for commit names.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to