<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # 創建標簽 在Git中打標簽非常簡單,首先,切換到需要打標簽的分支上: ``` $ git branch * dev master $ git checkout master Switched to branch 'master' ``` 然后,敲命令`git tag &lt;name&gt;`就可以打一個新標簽: ``` $ git tag v1.0 ``` 可以用命令`git tag`查看所有標簽: ``` $ git tag v1.0 ``` 默認標簽是打在最新提交的commit上的。有時候,如果忘了打標簽,比如,現在已經是周五了,但應該在周一打的標簽沒有打,怎么辦? 方法是找到歷史提交的commit id,然后打上就可以了: ``` $ git log --pretty=oneline --abbrev-commit 6a5819e merged bug fix 101 cc17032 fix bug 101 7825a50 merge with no-ff 6224937 add merge 59bc1cb conflict fixed 400b400 & simple 75a857c AND simple fec145a branch test d17efd8 remove test.txt ... ``` 比方說要對`add merge`這次提交打標簽,它對應的commit id是`6224937`,敲入命令: ``` $ git tag v0.9 6224937 ``` 再用命令`git tag`查看標簽: ``` $ git tag v0.9 v1.0 ``` 注意,標簽不是按時間順序列出,而是按字母排序的。可以用`git show &lt;tagname&gt;`查看標簽信息: ``` $ git show v0.9 commit 622493706ab447b6bb37e4e2a2f276a20fed2ab4 Author: Michael Liao <askxuefeng@gmail.com> Date: Thu Aug 22 11:22:08 2013 +0800 add merge ... ``` 可以看到,`v0.9`確實打在`add merge`這次提交上。 還可以創建帶有說明的標簽,用`-a`指定標簽名,`-m`指定說明文字: ``` $ git tag -a v0.1 -m "version 0.1 released" 3628164 ``` 用命令`git show &lt;tagname&gt;`可以看到說明文字: ``` $ git show v0.1 tag v0.1 Tagger: Michael Liao <askxuefeng@gmail.com> Date: Mon Aug 26 07:28:11 2013 +0800 version 0.1 released commit 3628164fb26d48395383f8f31179f24e0882e1e0 Author: Michael Liao <askxuefeng@gmail.com> Date: Tue Aug 20 15:11:49 2013 +0800 append GPL ``` 還可以通過`-s`用私鑰簽名一個標簽: ``` $ git tag -s v0.2 -m "signed version 0.2 released" fec145a ``` 簽名采用PGP簽名,因此,必須首先安裝gpg(GnuPG),如果沒有找到gpg,或者沒有gpg密鑰對,就會報錯: ``` gpg: signing failed: secret key not available error: gpg failed to sign the data error: unable to sign the tag ``` 如果報錯,請參考GnuPG幫助文檔配置Key。 用命令`git show &lt;tagname&gt;`可以看到PGP簽名信息: ``` $ git show v0.2 tag v0.2 Tagger: Michael Liao <askxuefeng@gmail.com> Date: Mon Aug 26 07:28:33 2013 +0800 signed version 0.2 released -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (Darwin) iQEcBAABAgAGBQJSGpMhAAoJEPUxHyDAhBpT4QQIAKeHfR3bo... -----END PGP SIGNATURE----- commit fec145accd63cdc9ed95a2f557ea0658a2a6537f Author: Michael Liao <askxuefeng@gmail.com> Date: Thu Aug 22 10:37:30 2013 +0800 branch test ``` 用PGP簽名的標簽是不可偽造的,因為可以驗證PGP簽名。驗證簽名的方法比較復雜,這里就不介紹了。 http://michaelliao.gitcafe.io/video/git-tags.mp4 ## 小結 * 命令`git tag &lt;name&gt;`用于新建一個標簽,默認為`HEAD`,也可以指定一個commit id; * `git tag -a &lt;tagname&gt; -m "blablabla..."`可以指定標簽信息; * `git tag -s &lt;tagname&gt; -m "blablabla..."`可以用PGP簽名標簽; * 命令`git tag`可以查看所有標簽。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看