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.

对于程序员来说确实是一搜索利器。

posted on 2013-12-02 15:51  古木月影  阅读(447)  评论(0编辑  收藏  举报

导航