These may come in real handy when setting up code commit infrastructure.
I was setting up code commit conventions, change log and release infrastructure in React & Angular codebases. It used the following things.
- Code commit conventions for message formatting.
- Version bumping and change log with
standard-release
. - Setting up and/or updating
README.md
andCONTRIBUTING.md
.
While doing this, many tags were created for testing in the branch. I wanted to avoid having all those future tags in the repo.
Hence, I needed to do the following.
- List all the tags meant for future releases.
- Delete them in the local branch.
- Delete them in the remote branch.
LIST
List all the tags
List all the tags, plus with matching pattern.
git tag --list
# Matching a pattern
git tag --list 'v*'
# The above matches tags starting with the letter "v"
DELETE
Delete the tags in the local and remote branch.
Local
git tag -d TAG1 TAG2 TAG3
# or
git tag --delete TAG1 TAG2 TAG3
Remote
git push origin -d TAG1 TAG2 TAG3
# or
git push origin --delete TAG1 TAG2 TAG3
The above commands will come in handy in a lot of different situations.
Best!
Srini @ RoverHead
Top comments (0)