0

After updating a tag's description following the command below:

git tag <tag name> <tag name> -f -m "<new message>"

How can I push the update to the that tag?

Ster-BigData
  • 89
  • 2
  • 11

1 Answers1

0

Try with

git push origin master --tags

From the manual

man git push

--tags
   All refs under refs/tags are pushed, in addition to refspecs explicitly listed on the command line.
mnestorov
  • 4,116
  • 2
  • 14
  • 24
  • The tag already exists in GitHub by the time the update was made locally. After the description was updated, how to push that to GitHub. This command gives an error 'error: failed to push some refs to 'https://github.....'' cuz the tag already exists ... – Ster-BigData Jul 03 '19 at 10:13
  • try to push with force `git push -f origin master --tags` – mnestorov Jul 03 '19 at 10:21
  • Like that it will create a new release with the same tag (overwrite)! I just want to update the description of an existing release ... – Ster-BigData Jul 03 '19 at 10:25
  • You can't change the name only of a tag. Git will calculate a new hash and will update the tree. – mnestorov Jul 03 '19 at 10:25
  • You can check locally that after you have updated your tag name, the hash will not be the same with the hash at origin – mnestorov Jul 03 '19 at 10:27
  • I don't understand! Am not trying to change the name, just the description. Maybe am wrong, so how it's possible to do it the right way? I mean, update a the tag's description, then push to remote repo without creating a new release (just push updates) – Ster-BigData Jul 03 '19 at 10:28
  • No worries, I think I am explaining it wrong. From this [answer](https://stackoverflow.com/questions/7813194/how-do-i-edit-an-existing-tag-message-in-git) you can see how to update a tag. It is also mentioned that this will overwrite the tag you have. You need to force push (`push -f`) in order for these changes to take effect – mnestorov Jul 03 '19 at 10:34
  • To see if you will do the right thing, check your local git history with `git log` and if the history shown is what you want, then you can force push in order for these changes to take effect remotely. – mnestorov Jul 03 '19 at 10:36
  • It takes effect, but instead of updating the existing tag, it releases a new one with the new description that I have updated. In my case, I just want to update the existing tag's description instead of creating a new tag with the new description ... – Ster-BigData Jul 03 '19 at 10:39
  • As far as I am aware, you can't do that. You need a new tag that overwrites the old one. – mnestorov Jul 03 '19 at 10:42