In this Tutorial we will learn about Git Tag. It will take just one mintue to get a basic idea about git tag. Let's start
- What are git tags?
- Why should i create git tags?
- When to create git tags?
- How to create tags in Git?
- Checkout to the branch in which we want to attach git tag: git checkout master
-
Create tag with specific version name: git tag v1.0
We can also create annotated tag: git tag -a v1.1 -m "tag for release v1.1" - Display/Show tags: git tag -l "v1.*"
-
Push tags to remote: git push origin v1.0
Push all tags at once: git push origin --tags or git push --tags - How to delete git tags?
- Delete tag from local: git tag -d v1.0
- Delete from remote:
- git push origin -d v1.0
- git push origin --delete v1.0
- Delete multiple tags at once:
-
Delete from local: git tag -d v1.0 v1.1
Delete from remote: git push origin -d v1.0 v1.1 - How do we checkout tags in git?
- Can i create a tag from some past commit?
Tagging in git or any other vcs refers to creating specific points in history for your repository/data. This is usually done to mark release points like: v1.0, v1.1, .....
To mark release points for your code/data. To create historic restore points.
When we want to create a release point for a stable version of our code. When we want to create a historic point for our code/data that can refer at any future time.
We can create tags in 4 steps:
We can't checkout tags in Git. We can create a branch from a tag and checkout the branch: git checkout -b releasevar1 v1.0
Yes. git tag v1.2 5fcdb03(commit name)