一些指令不經常使用總是愛忘記,用的時候又到處查詢很麻煩,簡單記錄,
1、在Git中打標簽非常簡單,首先,切換到需要打標簽的分支上
$ git branch
* dev
master
$ git checkout master
Switched to branch 'master'
2、敲命令git tag <name>就可以打一個新標簽
$ git tag v1.0.1
3、查看已經常見的Tag
$ git tag
v1.0.1
4、推送到遠程服務器上
$ git push origin --tags
補充說明:
一、要對以前內容打標簽 需要找到歷史提交的commit id,然后打上就可以了:
$ git log --pretty=oneline --abbrev-commit
be58e91 添加中文說明
007a52f 1.0.6 重新整理代碼
0116e99 Update README.md
fe62401 Delete MessageType.png
然后執行
$ git tag V1.0.6 007a52f
再用命令git tag查看標簽:
$ git tag
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/224473.html
標籤:其他
