If you work on a team that is constantly developing their code, then you are probably dealing with at least one repository that gets periodically tagged (such as when a code release is performed). If that is the case, then you have probably (or not) had to deal with setting the tags that get applied to the repository.
If so, then you would be able to see the tags on a repository with the following command:
$ git tag
If you are looking for a tag, but you only know part of it, you can certainly use grep to weed through the potentially large list of tags that will be presented to you. Now, if you happen to set a tag incorrectly, or apply it to the wrong repository (or branch of that repository, for instance), you are not stuck. You can remove it. Here are the steps:
- First, ensure you are in the repository in question and in the correct branch, then do a 'git pull' to ensure you are at the latest change
- Run 'git tag | grep <tag>' to get the tag name you need to remove
- Run 'git tag -d <tag_name>' <--- This will remove the tag in your local repository
- Run 'git push --delete origin <tag_name>' <--- This will remove the tag from the remote repo
- Run 'git pull'
No comments:
Post a Comment