Chan Chen Coding...

          Git Tag Release

          How do you 'mark' 'tag' or 'release' a particular set of revisions for a particular set of files so you can always pull that one later?

          Using the git tag command.

          To simply "tag" the current revision, you would just run..

          git tag -a thetagname 
          git tag -a 0.1
          git tag -a 2.6.1-rc1 -m 'Released on 01/02/03'

          To list the current tags, simply run git tag with no arguments, or -l (lower case L):

          $ git tag -a thetagname # and enter a message, or use -m 'My tag annotation' 
          $ git tag -l thetagname

          To delete a tag, you use the -d flag:

          $ git tag -d thetagname  Deleted tag 'thetagname' 
          $ git tag [no output]

          To tag a specific (previous) commit, you simply do..

          git tag [tag name] [revision SHA1 hash] 

          For example:

          git tag 1.1.1 81b15a68c6c3e71f72e766931df4e6499990385b 


          Note: by default, git creates a "lightweight" tag (basically a reference to a specific revision). The "right" way is to use the -a flag. This will launch your editor asking for a tag message (identical to asking for a commit message, you can also use the -m flag to supply the tag message on the command line). Using an annotated tag creates an object with its own ID, date, tagger (author), and optionally a GPG signature (using the -s tag). For further information on this, see this post

          git tag mytagwithmsg -a -m 'This is a tag, with message' 

          And to list the tags with annotations, use the -n1 flag to show 1 line of each tag message (-n245 to show the first 245 lines of each annotation, and so on):

          $ git tag -l -n1 mytagwithmsg    This is a tag, with message 



          -----------------------------------------------------
          Silence, the way to avoid many problems;
          Smile, the way to solve many problems;

          posted on 2012-04-13 11:43 Chan Chen 閱讀(1069) 評論(0)  編輯  收藏 所屬分類: Git


          只有注冊用戶登錄后才能發表評論。


          網站導航:
          博客園   IT新聞   Chat2DB   C++博客   博問  
           
          主站蜘蛛池模板: 余姚市| 界首市| 怀仁县| 上虞市| 玉龙| 兴义市| 河间市| 福清市| 新化县| 咸阳市| 隆德县| 大宁县| 巴彦县| 阿巴嘎旗| 九江市| 安丘市| 丹阳市| 荥经县| 万全县| 民和| 河池市| 寻乌县| 类乌齐县| 深水埗区| 平远县| 阿巴嘎旗| 云浮市| 竹北市| 洛阳市| 阿勒泰市| 孟州市| 平南县| 甘洛县| 连城县| 桐梓县| 阿坝县| 旬阳县| 都安| 广平县| 怀仁县| 大化|