Git 远程分支的查看及相关问题
命令:git ls-remote -t 或者 git ls-remote --tag
運行結果如下:
0975ebc0f9a6b42ecbe066a50a26a678a0753b4d refs/tags/1.0 fecbbe3a7ed4c8b5305ddd77b69d7ee64acbefe5 refs/tags/1.0^{}解讀:
由于 tag 1.0 是一條帶注釋的 tag, 因此在查看遠程 tag 的結果列表中會出現 1.0 和 1.0^{} 兩項。
其中 1.0 表示的是真正的 tag 對象,可以通過 git cat-file 命令查看其類型:
$ git cat-file -t 0975 tag而 1.0^{} 表示的是該 tag 對象所指向的提交對象,同樣可以查看其類型:
$ git cat-file -t fecb commit(上述解釋參考自:Git tag, Why this duplicate tag in remotes?)
題外:為了搜索對上述問題的解讀,通過關鍵字 “git ^{}” 在 Google 中搜索時,發現后面的特殊字符完全被忽略,即使用雙引號包圍起來也還是無效。因此,為了解決如何搜索特殊字符這一問題而繼續 Google 之,終于發現了一個可以支持特殊字符搜索的搜索引擎:
SymbolHound.
上面的參考鏈接也正是通過它搜索得到的。
正如網站首頁說明的:
SymbolHound is a search engine that doesn't ignore special characters. This means you can easily search for symbols like &, %, and π. We hope SymbolHound will help programmers find information about their chosen languages and frameworks more easily.
對于程序員來說確實是一搜索利器。
轉載于:https://www.cnblogs.com/gumuyueying/p/git-list-remote-tag.html
總結
以上是生活随笔為你收集整理的Git 远程分支的查看及相关问题的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 开发们 点广告-赚点BT币
- 下一篇: Serializable和Parcela