git-tag

Get last git tag from a remote repo without cloning

≯℡__Kan透↙ 提交于 2019-11-28 15:57:52
问题 How to get last tag from a (non checked-out) remote repo? On my local copy I use describe git describe --abbrev=0 --tags But I cannot use describe with remote storage 回答1: Use git ls-remote --tags <repository> For example, if we want to know what the latest tag that Git is at we would do git ls-remote --tags git://github.com/git/git.git That returns a long list with all the tags in alphabetical order, as shown below (truncated for sanity's sake). The last line tells us the latest tag is v1.8

How to list all tags along with the full message in git?

我与影子孤独终老i 提交于 2019-11-28 15:05:21
I want git to list all tags along with the full annotation or commit message. Something like this is close: git tag -n5 This does exactly what I want except that it will only show up to the first 5 lines of the tag message. I guess I can just use a very large number. What is the highest number I can use here? Is it the same on every computer? UPDATE : I have had much time to think about this, and now I think I don't necessarily want to show the entire message if it is extraordinarily long. Something like this seems to work fine for me: git tag -n99 If the tag message is really longer than 99

How to create a new branch from a tag?

ⅰ亾dé卋堺 提交于 2019-11-28 14:55:53
I'd like to create a new master branch from an existing tag. Say I have a tag v1.0 . How to create a new branch from this tag? Wow, that was easier than I thought: git checkout -b newbranch v1.0 user1069067 If you simply want to create a new branch without immediately changing to it, you could do the following: git branch newbranch v1.0 I used the following steps to create a new hot fix branch from a Tag. Syntax git checkout -b <New Branch Name> <TAG Name> Steps to do it. git checkout -b NewBranchName v1.0 Make changes to pom / release versions Stage changes git commit -m "Update pom versions

Switch to another Git tag

青春壹個敷衍的年華 提交于 2019-11-28 14:51:35
问题 How do I check out version version/tag 1.1.4 of the rspec bundle? cd ~/Library/Application\ Support/TextMate/Bundles/ git clone git://github.com/rspec/rspec-tmbundle.git RSpec.tmbundle osascript -e 'tell app "TextMate" to reload bundles' 回答1: Clone the repository as normal: git clone git://github.com/rspec/rspec-tmbundle.git RSpec.tmbundle Then checkout the tag you want like so: git checkout tags/1.1.4 This will checkout out the tag in a 'detached HEAD' state. In this state, "you can look

How can I list all lightweight tags?

大憨熊 提交于 2019-11-28 09:48:39
I want to list all of the lightweight tags in my repository; the best I can think of involves combining git for-each-ref , grep , and cut , but it seems like it'll be kind of fiddly... (While we're at it, we might as well talk about the same thing for annotated tags: someone is sure to end up here wondering about that at some point.) Edit: By lightweight tags, I meant those tag refs that do not refer to tag objects. (In other words, unannotated tags.) torek All the lightweight tags are in the refs/tags/ namespace and can be enumerated with, e.g.: git for-each-ref --format '%(refname:short)'

Checkout a tag from a private GitHub repository

拟墨画扇 提交于 2019-11-28 05:36:16
问题 I need to clone a private repository from GitHub, but I only want to get a specific tag (so basically, cloning is actually the wrong term for it). Now, the problem is that there are multiple options, and all of them don't really work out: GitHub offers tagged versions as archives, but they are not accessible via curl or wget (at least I could not figure out how). GitHub does not support archiving repositories. I could run a git clone and then run a git checkout to get to the version specified

Show which git tag you are on?

偶尔善良 提交于 2019-11-28 02:39:53
I'm having trouble finding out which tag is currently checked out. When I do: git checkout tag1 git branch I can't seem to find out which tag I'm on. It only logs: * (no branch) master Is it possible to find out which tags are checked out? In the above example, this would be tag1 . bstpierre Edit : Jakub Narębski has more git-fu. The following much simpler command works perfectly: git describe --tags (Or without the --tags if you have checked out an annotated tag. My tag is lightweight, so I need the --tags.) original answer follows: git describe --exact-match --tags $(git log -n1 --pretty='%h

How do you push a Git tag to a branch using a refspec?

陌路散爱 提交于 2019-11-28 02:35:45
I want to force push, for example, my tag 1.0.0 to my remote master branch. I'm now doing the following: git push production +1.0.0:master I want to force the push , because all I care about is that the code inside the 1.0.0 tag is pushed to the master branch on the remote repository. What am I doing wrong? Update #1 When I SSH into my server where my Git repository is and execute git branch -l , I don't see the master branch listed either. Update #2 After running git tag -l from inside the remote Git repository, I see that master is listed, meaning that when I ran the following: git push

Create a tag in a GitHub repository

徘徊边缘 提交于 2019-11-28 02:30:38
I have a repository in GitHub and I need to tag it. I tagged in a shell, but on GitHub it is not showing up. Do I have to do anything else? The command I used in the shell is: git tag 2.0 And now when I type git tag it shows: 2.0 So it seems like tags are present, correct? The repository is: https://github.com/keevitaja/myseo-pyrocms . How do I make this tag show up on GitHub? Where are my tags? You can create tags for GitHub by either using: the Git command line, or GitHub's web interface. Creating tags from the command line To create a tag on your current branch, run this: git tag <tagname>

How to tag an older commit in Git?

荒凉一梦 提交于 2019-11-28 02:30:32
We are new to git, and I want to set a tag at the beginning of our repository. Our production code is the same as the beginning repository, but we've made commits since then. A tag at the beginning would allow us to "roll back" production to a known, stable state. So how to add a tag to an arbitrary, older commit? dkinzer Example: git tag -a v1.2 9fceb02 -m "Message here" Where 9fceb02 is the beginning part of the commit id. You can then push the tag using git push origin v1.2 . You can do git log to show all the commit id's in your current branch. There is also a good chapter on tagging in