Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Git tags - can't pull new tags

Tags:

git

bitbucket

we're 2 people trying to use git on bitbucket. the developer is using simple tags to track all commits - and the QA guys is trying to pull new code in based on tags.

so dev decided to

git commit -v -am "($date) $comments"
git tag -a version-1 -m "($date) $comments"
git push --tags

The QA guy did

  git clone <path> ; cd $dir
  git checkout tags/version-1

This does the needed the first time around - but the second time - for the update tag - it give error message.

first time for QA

  • check out is successful with message

    Note: checking out 'tags/version-1'.

    You are in 'detached HEAD' state. You can look around, make experimental
    changes and commit them, and you can discard any commits you make in this
    state without impacting any branches by performing another checkout.
    
    If you want to create a new branch to retain commits you create, you may
    do so (now or later) by using -b with the checkout command again. Example:
    
      git checkout -b <new-branch-name>
    
    HEAD is now at 0c3514c... (02-28-2016) test comments
    

then the dev guy did his changes and then did

 git commit -v -am "($date) $comments"
 git tag -a version-2 -m "($date) $comments"
 git push --tags

It went through - and we can see the new tag on repo - with changes.

The QA guy does his changes

 git checkout tags/version-2

Error message is

error: pathspec 'tags/version-2' did not match any file(s) known to git.

But

If QA does

  git clone <path> ; cd $dir
  git checkout tags/version-2

it works fine !!! how can the QA guy update the same git director with new tags that the dev guy is checking in ?

like image 603
hypermails Avatar asked Dec 16 '25 14:12

hypermails


1 Answers

ok - found the answer as I was browsing the other links on stack.

First make sure that the tag exists locally by doing

git fetch --tags

Then check out the tag by running

git checkout tags/<tag_name>

thanks to Git - Checkout a remote tag when two remotes have the same tag name (second answer)

like image 63
hypermails Avatar answered Dec 19 '25 07:12

hypermails



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!