git tag建立裡程碑

來源:互聯網
上載者:User

不帶說明的輕量級裡程碑不推薦使用。

帶簽名的太麻煩,不搞。這裡介紹帶說明的裡程碑建立和管理。

先提交一下:

git commit --allow-empty -m "commit before adding test tag"[master bcab410] commit before adding test tag

建立裡程碑:

git tag -m' add test tag1' testTag1

testTag1 前面也可以用-a 參數,比如:

git tag -a 0.1.0 -m 'm1 for version 1.0'

查看裡程碑:

git tag -n10testTag1         add test tag1

-n後面的10指的是查看10個裡程碑資訊

尋找裡程碑對應的commit id:

$ git log --oneline --decoratebcab410 (HEAD, tag: testTag1, origin/master, origin/HEAD, master) commit before adding test tag

有了這個,就可以用reset命令回到那個提交的版本。

如果想將建立的tag push到遠程分支上。用下面的命令

git push --tags

假定當前本地分支為master,這樣遠端master分支上也會出現tag.

刪除tag也很簡單

git tag -d 10Deleted tag '10' (was 42aab4c)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.