git-tag

Git - Checkout a remote tag when two remotes have the same tag name

ⅰ亾dé卋堺 提交于 2019-11-26 09:17:05
问题 I had hoped this would work: git checkout remote/tag_name but it doesn\'t. This does: git checkout tags/tag_name but I\'m doing something weird where I have a lot of remotes, and I\'m worried about what happens if two remotes have the same tag. Is there a way to specify the remote when checking out the tag? 回答1: Executive summary: what you want to achieve is possible, but first you must invent remote tags. You do this with a series of refspecs, one for each remote. The rest of this is about

How to list all Git tags?

限于喜欢 提交于 2019-11-26 08:42:32
问题 In my repository, I have created tags using the following commands. git tag v1.0.0 -m \'finally a stable release\' git tag v2.0.0 -m \'oops, there was still a major bug!\' How do you list all the tags in the repository? 回答1: git tag should be enough. See git tag man page You also have: git tag -l <pattern> List tags with names that match the given pattern (or all if no pattern is given). Typing "git tag" without arguments, also lists all tags. More recently ("How to sort git tags?", for Git 2

How do you rename a Git tag?

左心房为你撑大大i 提交于 2019-11-26 08:38:49
问题 Today I was looking through the logs for a project and realized that I fat fingered a tag name some time ago. Is there some way to rename the tag? Google hasn\'t turned up anything useful. I realize I could check out the tagged version and make a new tag, I even tried that. But that seems to create a tag object that isn\'t quite right. For one, git tag -l lists it out of order relative to all of the other tags. I have no idea if that\'s significant, but it leads me to believe that the new tag

How do I edit an existing tag message in git?

不想你离开。 提交于 2019-11-26 07:53:57
问题 We have several annotated tags in our git repository. The older tags have bogus messages that we would like to update to be in our new style. % git tag -n1 v1.0 message v1.1 message v1.2 message v2.0 Version 2.0 built on 15 October 2011. In this example, we would like to make v1.x messages look like the v2.0 message. Anyone know how we would do this? 回答1: git tag <tag name> <tag name>^{} -f -m "<new message>" This will create a new tag with the same name (by overwriting the original). 回答2: To

Why should I care about lightweight vs. annotated tags?

浪尽此生 提交于 2019-11-26 06:54:35
问题 I switched from Subversion to Git as my day-to-day VCS last year and am still trying to grasp the finer points of \"Git-think\". The one which has been bothering me lately is \"lightweight\" vs. annotated vs. signed tags. It seems pretty universally accepted that annotated tags are superior to lightweight tags for all real uses, but the explanations I\'ve found for why that\'s the case always seem to boil down to either \"because best practices\" or \"because they\'re different\".

What is git tag, How to create tags & How to checkout git remote tag(s)

浪尽此生 提交于 2019-11-26 06:50:43
问题 when I checkout remote git tag use command like this: git checkout -b local_branch_name origin/remote_tag_name I got error like this: error: pathspec `origin/remote_tag_name` did not match any file(s) known to git. I can find remote_tag_name when I use git tag command. 回答1: 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

How to tell which commit a tag points to in Git?

ぐ巨炮叔叔 提交于 2019-11-26 06:09:30
问题 I have a bunch of unannotated tags in the repository and I want to work out which commit they point to. Is there a command that that will just list the tags and their commit SHAs? Checking out the tag and looking at the HEAD seems a bit too laborious to me. Update I realized after I went through the responses that what I actually wanted was to simply look at the history leading up to the tag, for which git log <tagname> is sufficient. The answer that is marked as answer is useful for getting

How to delete a remote tag?

情到浓时终转凉″ 提交于 2019-11-26 03:25:42
问题 How do you delete a Git tag that has already been pushed? 回答1: You just need to push an 'empty' reference to the remote tag name: git push origin :tagname Or, more expressively, use the --delete option (or -d if your git version is older than 1.8.0): git push --delete origin tagname Note that git has tag namespace and branch namespace so you may use the same name for a branch and for a tag. If you want to make sure that you cannot accidentally remove the branch instead of the tag, you can

How can I move a tag on a git branch to a different commit?

三世轮回 提交于 2019-11-26 02:39:04
问题 I created a tag on the master branch called v0.1 like this: git tag -a v0.1 But then I realized there were still some changes I needed to merge into master for release 0.1, so I did that. But now my v0.1 tag is stuck on (to invoke the post-it note analogy) the wrong commit. I want it to be stuck on the most recent commit on master, but instead it is stuck on the second most recent commit on master. How can I move it to the most recent commit on master? 回答1: Use the -f option to git tag: -f -

How is a tag different from a branch in Git? Which should I use, here?

試著忘記壹切 提交于 2019-11-26 02:28:28
I am having some difficulty understanding how to use tags versus branches in git . I just moved the current version of our code from cvs to git , and now I'm going to be working on a subset of that code for a particular feature. A few other developers will be working on this as well, but not all developers in our group are going to care about this feature. Should I be creating a branch or a tag? In what situations should I be using one versus the other? tvanfosson A tag represents a version of a particular branch at a moment in time. A branch represents a separate thread of development that