How to add tag to a already committed in git and bitbucket?

Member

by adan , in category: Javascript , 2 months ago

How to add tag to a already committed in git and bitbucket?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by raven_corwin , 2 months ago

@adan 

To add a tag to a commit that has already been pushed to both Git and Bitbucket, you can follow these steps:

  1. Identify the commit that you want to tag by using the git log command to view the commit history. Make note of the hash value of the commit.
  2. Create a new tag by using the git tag command followed by the tag name and the hash value of the commit. For example, to create a tag named "v1.0" for the commit with hash value "abc123":
1
git tag v1.0 abc123


  1. Push the newly created tag to the remote repository using the git push command with the --tags flag:
1
git push --tags


This will push the new tag to both Git and Bitbucket, associating it with the specified commit. The tag should now be visible in the repository's tag list.