Questions tagged [git-describe]

44 questions
84
votes
4 answers

"git describe" ignores a tag

In the following lines: $ git tag -n1 v1.8 Tagged the day before yesterday v1.9 Tagged yesterday v2.0 Tagged today $ git describe v1.9-500-ga6a8c67 $ Can anyone explain why the v2.0 tag is not used by "git describe", and how…
knipknap
  • 5,934
  • 7
  • 39
  • 43
77
votes
7 answers

Get last git tag from a remote repo without cloning

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
fl00r
  • 82,987
  • 33
  • 217
  • 237
12
votes
1 answer

what does the hash from `git describe` refer to?

$ git describe --tags --long test-1-g3c31c73 \_ ??? The g3c31c73 doesn't seem to point to anything... The doc says it's the abbreviated object name of the most recent commit, but it's not the HEAD commit hash, and find .git/objects -type…
dwelle
  • 6,894
  • 2
  • 46
  • 70
9
votes
2 answers

Should I Git Merge Develop Into Master and Then Back After Tagging?

The question is: how do I achieve the correct version (shown with git describe) on develop after I merged it into master and tagged master? I use common git branching - master for production. Let's say git describe shows 1.5 on master, and, after…
Denis Chmel
  • 780
  • 6
  • 11
9
votes
2 answers

git describe show only latest tag and additional commits

Is there any syntax for git describe to display only the latest tag and additional commits? So that you get 4.0.7 for being at the commit tagged 4.0.7 4.0.7-12 for having 12 commits since tag 4.0.7 git describe --tags is pretty close with…
gherkins
  • 14,603
  • 6
  • 44
  • 70
9
votes
1 answer

Why is "git describe" showing an older tag version on my clean git repo copy?

Some background: I currently have two local git repos which point to the same origin/master project. The reason I have two git repos is so that I have a clean master copy that I can use whenever I need and the one copy which my sandbox where I can…
lifesabeach
  • 93
  • 1
  • 5
9
votes
3 answers

Why is `git describe -dirty` adding a `-dirty` suffix when describing a clean checkout?

I have just discovered the --dirty option to git describe and it looks like it should do something very useful, i.e. append a suffix to the output of git describe when the working tree is dirty, however that doesn't seem to be the case on some of my…
Mark Booth
  • 7,605
  • 2
  • 68
  • 92
8
votes
2 answers

GIT checking out code from output of "git describe"

I am thinking about using git describe to generate automated version numbers. As suggest here. My question is that if I get o/p of git describe as v2.0-64-g835c907, how can I checkout that particular revision number using git in future?
Vivek Goel
  • 22,942
  • 29
  • 114
  • 186
5
votes
2 answers

How to call git commands during AWS CodeBuild

I need to show the "build version" in my application. For that purpose, I am using the npm package 'git-describe', which fetches the 'distance' of the current Git commit from the last Git tag. It works fine locally where the .git folder is available…
Sandeep Parashar
  • 197
  • 1
  • 14
5
votes
2 answers

Make Git show the correct tag on branches with git describe

git describe is documented to find the most recent tag that is reachable from a commit. Source: git describe --help I am a little lost understanding how exactly a tag is reachable from a commit. When run in a branch I'm not seeing the behavior I…
Marcel Stör
  • 22,695
  • 19
  • 92
  • 198
5
votes
0 answers

Is there a way to run 'git describe' on a git repository without having to do a 'git clone' first?

I've got a script that needs to quickly gather the output of 'git describe' on a specific branch of a remote git repository, in order to set an environment variable. The obvious way to do that would be to do a 'git clone' to download the repository,…
Jeremy Friesner
  • 70,199
  • 15
  • 131
  • 234
4
votes
2 answers

Why is git describe picking out the tag that it does

I am developing an internal web application for a company I am doing some work for. It is hosted on a private github repository, but most of my development is done on my linux desktop at home, and the web server for this is hosted in the companies…
akc42
  • 4,893
  • 5
  • 41
  • 60
4
votes
0 answers

Can I change how git-describe counts commits?

My question is related to git describe: inexplicable commit count and commit count calculation in git-describe, but not quite identical to either question. I've been developing on a feature branch in my current project, and I've been using git…
rmunn
  • 34,942
  • 10
  • 74
  • 105
4
votes
2 answers

Git: How to get the name of checked out tag when 2/more tags on same commit

I have a git commit with 2 tags, like this: commit1-----tagA,tagB Checkout "tagA" by git checkout tagA Question: How to get the tag name of current checkout? I have try git describe, but it's always return name "tagB", expect return "tagA". Seems…
chenchang
  • 55
  • 5
4
votes
3 answers

git version relative to a specific tag

We're using multiple tag identifiers in our repo. Eg. ABC-1.3.5.234 and DEF-1.2.1.25. The describe command gives me almost what I want: git describe --long ABC-1.3.5.234-33-deadbeef But I really wanted to know the value relative to the most recent…
Jeremy Woodland
  • 3,444
  • 5
  • 17
  • 25
1
2 3