git tag 给提交内容打标签

参考pro git 2.6总结的


Add tag--Two way to add tag
    Light weight--only point to the commit
        COMMAND : git tag v1.0.0

    Annotated
        COMMAND : git tag -a v1.0.0 -m 'nexus first board'

Show Tag
    1. show all tags
        COMMAND : git tag
    2. Show the specific tag
        COMMAND : git tag v1.0

Advanced Skill
How to add a tag to old commit if I have forgot to tag one?
    1.Firstly , show your commit
        COMMAND : git log --pretty=oneline

Results is like this:
e1c6c38fab23f8281267b0b41109a48dd2a26227 set TARGET_ROCKCHIP_PCBATEST to false
87fd66414c1027febdcfa8554d0f2fdb66290c6f add last-one hot key

    2.I want to tag this commit 'add last-one hot key'
        COMMAND :git tag -a v1.2.1 87fd66 -m 'Add a new tag'

        note:87fd66 is the begin of the commit number.

Share your tag:
    1.  Push Specific tag
        COMMAND : git push origin v1.2.1

    2. Push all the tags
        COMMAND : git push origin --tags
        

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值