You need to fix a bug in the version 1.2 of your app. Checkout the tag
v1.2
(Note: There is also a branch namedv1.2
).你要在 1.2 版本中修復(fù)一個(gè) bug,切換到 tag 'v1.2'(注意:現(xiàn)在有一個(gè)分支也叫 'v1.2')。
如果存在一個(gè)和分支同名的 tag,比如都叫 'v1.2',那么當(dāng)執(zhí)行 git checkout v1.2
命令時(shí),是該切換到分支,還是該切換到 tag 呢?答案是切換到分支。
如果要切換到 tag,就需要按下面這樣給出明確的說(shuō)明:
$ git checkout tags/tag-name
第34關(guān)過(guò)關(guān)畫(huà)面如下:
http://wiki.jikexueyuan.com/project/githug-walkthrough/images/level-34-checkout-tag-over-branch.png" alt="第34關(guān) checkout_tag_over_branch" />