I want v0.1.27 of nodejs code base.
This is what I did.
git clone git://github.com/ry/node.git
cd node
git checkout -b v0.1.27
However when I look at v0.1.27 code base changelog there I see changelog for 0.1.32 also. It seems I did not checkout v0.1.27.
How do I checkout a branch from a tag?
To switch to a normal branch, use git switch <branch-name> . To switch to a commit-like object, including single commits and tags, use git switch --detach <commitish> , where <commitish> is the tag name or commit number.
Listing the available tags in Git is straightforward. Just type git tag (with optional -l or --list ). You can also search for tags that match a particular pattern. The command finds the most recent tag that is reachable from a commit.
To do so, we'll use the command git clone -b <tag> --single-branch <remote_repository> . The -b option accepts a tag or a branch you want to clone. The --single-branch option indicates that just the tag supplied by option -b will be cloned to local.
If you have the hash for a commit, you can use the git show command to display the changes for that single commit. The output is identical to each individual commit when using git log -p .
What you did is create a local branch, called v0.1.27, starting from HEAD. If you only want to have a look at the v0.1.27 tag, just remove the -b
option:
git checkout v0.1.27
If you plan to make changes, you might want to create a tracking branch:
git checkout -b --tracking my_v0.1.27 v0.1.27
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With