git tag tag

1.Create tag tag
Create a local tag: git tag, such as git tag v1.0.
2. Push tag tag
It should be noted that pushing tags and pushing branches are not the same thing. Tags need to be pushed separately after they are created.
Push tag label: git push origin, push to the remote warehouse. Such as git push origin v1.0.
Push multiple unpushed local tags: git push origin --tags
3. View tags
View all local tags: git tag.
View all tags in the remote repository: git ls-remote --tags origin.
View the detailed information of a locally specified tag: git show.
4. Switch tabs
Before switching tags, make sure that the current code is unchanged. If it has been changed, you need to execute the command git checkout. Cancel the current unsaved changes.
Switch tags: git checkout.
View the historical commit records of the remote warehouse: git log.
5. Delete tags
Delete local tags: git tag -d.
Delete remote tags: git push origin :refs/tags/.
6. Pull the specified tag tag code
clone specifies tag tag code: git clone --branch [tag] [git address]
The git reflog  command can view all operation record information of all branches (including the previous commitID that has been reset). For example: execute git reset --hard HEAD~1 to return to the previous version. Using git log, you cannot see the deleted commitid. Using git reflog, you can see the deleted commitid, so that we can buy regret medicine. Revert to the deleted version.

Guess you like

Origin blog.csdn.net/jyf_568/article/details/133767181