git-tag

Fetch a single tag from remote repository

妖精的绣舞 提交于 2019-12-03 12:10:48
问题 This command fetches all tags: git fetch origin --tags This command fetches a specific tag: git fetch origin refs/tags/1.0.0 But that doesn't let me do: git checkout tags/2.3.18 How can I fetch a single tag and then perform a checkout? 回答1: git fetch origin refs/tags/1.0.0 This fails because it doesn't write a local reference: it obtains the remote's refs/tags/1.0.0 , and any tag object(s), commits, etc., required to go with it; it drops those into FETCH_HEAD (as all git fetch commands always

Git tag for a subfolder of a repository

余生长醉 提交于 2019-12-03 12:03:52
I use Git to import a SVN repository. Then I created my own project as a subfolder in the repository. I use the SVN repository with Git-SVN. My working procedure is: git commit -am "message" git svn rebase git svn dcommit . Now I want to tag my project with git tag -a RC1 -m 'Release Candidate 1' , but I only want that my project gets the tag. How can I do that? tavnab TL;DR version It's possible to tag specific directories (aka trees) if you know the tree's SHA-1, but it's not often done & not easy to do useful things with that tag. Long answer Every object in Git has a unique SHA-1. Most

Git tag release version?

人盡茶涼 提交于 2019-12-03 10:05:49
问题 A pre-release version MAY be denoted by appending a dash and a series of dot separated identifiers immediately following the patch version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92. semver.org For the purpose of disambiguation, what would be a "proper" way to tag a release commit (commit from the master branch)? Some ideas v1.7.2-release v1.7.2-master v1.7.2-prod v1.7.2-official v1.7.2-stable github.com/antirez/redis/tags 回答1: You can choose a policy similar to Git

Git force push tag when the tag already exists on remote

ε祈祈猫儿з 提交于 2019-12-03 09:31:04
I have a tag already pushed onto the remote, and when another user creates the same tag and tries to push, push will fail because tag already exists on the remote. But I thought if I do --f force tag push, it should be work. But that is not what I see. I think I have to do this. Create tag Push tag -> If push fails -> Delete tag on remote -> push tag again. Is this correct? Isnt force push tag supposed to take care of this? I am using annotated tags with git -a v1.0 -f -m "message" In my case, remote was rejecting an force push when the tag already exists. So, when the push was rejected, I did

Add new commit to the existing Git tag

孤街浪徒 提交于 2019-12-03 08:24:29
问题 I have created a Git tag as v1.1 using git tag -a v1.1 -m 'my version 1.1' and I pushed that tag. Later, I made some changes related to v1.1 . Now when I push new changes and check the git tag using git describe it is showing me v1.1-g2dcc97 . How can I add my new commit to the existing tag? 回答1: You can't put a new commit into an existing tag without breaking an important Git guideline: Never(*) modify commits that you have published. Tags in Git aren't meant to be mutable. Once you push a

Is there a simple command to convert a branch to a tag?

半城伤御伤魂 提交于 2019-12-03 08:19:35
问题 I am about to complete a tedious process of converting "dumb snapshots" to git. This process has been going very well (thanks to this rename process), but now I realized that some of the branches that I created, do not merit a branch but rather a tag . Since everything is still local (never pushed to a repository), I found this question (and associated answer) somewhat more cumbersome than I prefer, so I was wondering whether I can take a shortcut via some simple "convert-from-branch-to-tag"

Git: distinguish between local and remote tags

旧时模样 提交于 2019-12-03 05:40:45
问题 If there are tags in the remote repository, I'm usually getting them automatically when pulling. When I delete the created local tag ( git tag -d <tag-name> ) and pull, the deleted tag will be recreated. I can delete remote branches/tags ( git push <remote-branch/tag-name>:<branch/tag-name> ), but how can I detect that the local tag was created by fetching a remote tag ? 回答1: If you're annoyed about these tags being recreated when you run git pull , you turn off the fetching of tags by

Do git tags apply to all branches?

笑着哭i 提交于 2019-12-03 05:26:44
I'm getting my feet wet with git tagging, but my previous background is in Subversion, where "tags" were really just copies, not "real" tags... If I add a tag to a git repo, is it applied to all branches or only the current one? For example, if I currently have these branches ( git branch -v ): * master deadbeef My master head comment dev baddfeed My def head comment And the currently checked out branch is master, as you can see. Now suppose I git tag -a TAGNAME , does TAGNAME apply only to deadbeef (master branch) or to baddfeed (dev branch) as well? e.g., Say I subsequently switch to the dev

What names are valid git tags?

断了今生、忘了曾经 提交于 2019-12-03 04:08:54
I have got a error message while creating tag containing [ character: fatal: '[' is not a valid tag name. Question: are there any rules for tags in the git? Willem Van Onsem You can check if the name is valid with git check-ref-format This page contains the constraints on a valid name. Quoted from the page (possibly outdated in the future): They can include slash / for hierarchical (directory) grouping, but no slash-separated component can begin with a dot . or end with the sequence .lock . They must contain at least one / . This enforces the presence of a category like heads/ , tags/ etc. but

Why git doesn't push tags by default?

ぐ巨炮叔叔 提交于 2019-12-03 02:59:24
The default behavior of Git is not to push tags from a local repository to an associated remote one. In this answer it is explained how to change this behavior for a single repository. My question, is why is this the designed behavior of Git? In particular what are the cons of setting on automatic push of tags? VonC If you consider the tags of any large project ( kernel linux , git itself , ...) you would see tags in the hundreds . A Distributed VCS is all about publication : what do you want to push? Everything? All the time? Pushing all tags can pollute the tags space from the upstream repo