How to clone a specific Git tag
git clone –depth 1 –branch <tag_name> <repo_url> –depth 1 is optional but if you only need the state at that one revision, you probably want to skip downloading all the history up to that revision.
git clone –depth 1 –branch <tag_name> <repo_url> –depth 1 is optional but if you only need the state at that one revision, you probably want to skip downloading all the history up to that revision.
Try this it will list all the tags along with annotations & 9 lines of message for every tag: git tag -n9 can also use git tag -l -n9 if specific tags are to list: git tag -l -n9 v3.* (e.g, above command will only display tags starting with “v3.”) -l , –list List tags … Read more
From the npm docs, using a git URL: git://github.com/<user>/<project>.git#<branch> git://github.com/<user>/<project>.git#feature\/<branch> As of NPM version 1.1.65, you can use a shorten github URL: <user>/<project>#<branch> UPDATE 2022 Don’t use git:// protocol for GitHub, as it is not supported npm ERR! The unauthenticated git protocol on port 9418 is no longer supported. npm ERR! Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for … Read more
TL;DR The difference between the commands is that one provides you with a tag message while the other doesn’t. An annotated tag has a message that can be displayed with git-show(1), while a tag without annotations is just a named pointer to a commit. More About Lightweight Tags According to the documentation: “To create a … Read more
One way to do this would be with git rev-list. The following will output the commit to which a tag points: $ git rev-list -n 1 $TAG NOTE This works for both Annotated and Unannotated tags You could add it as an alias in ~/.gitconfig if you use it a lot: [alias] tagcommit = rev-list … Read more
This is great question, I’d been wondering the same thing. I didn’t want to write a script so sought a different solution. The key is discovering that you can delete a tag locally, then use git fetch to “get it back” from the remote server. If the tag doesn’t exist on the remote, then it … Read more
To get the most recent tag (example output afterwards): git describe –tags –abbrev=0 # 0.1.0-dev To get the most recent tag, with the number of additional commits on top of the tagged object & more: git describe –tags # 0.1.0-dev-93-g1416689 To get the most recent annotated tag: git describe –abbrev=0
From the theoretical point of view: tags are symbolic names for a given revision. They always point to the same object (usually: to the same revision); they do not change. branches are symbolic names for line of development. New commits are created on top of branch. The branch pointer naturally advances, pointing to newer and … Read more
Wow, that was easier than I thought: git checkout -b newbranch v1.0
Let’s start by explaining what a tag in git is A tag is used to label and mark a specific commit in the history. It is usually used to mark release points (eg. v1.0, etc.). Although a tag may appear similar to a branch, a tag, however, does not change. It points directly to a … Read more