1.查看commit和对应的引用类型
refs/reviewable
:引用一般包含待审查的变更集或者补丁的提交记录
refs/pull/xxx/head
:引用指向拉取请求的源分支的最新提交
refs/pull/xxx/merge
:引用指向合并后代码状态
git ls-remote origin
cb825687a592709f902f3d320d93987a0546fd28 HEAD
79c71f24e4cb064852e2cbbfef78a0a051eb7ced refs/heads/0.12.x
e8c5be1214c61247c73a0eef33585ab6e26d0e83 refs/pull/1003/head
ea997992895708deae3daf0094488ccc76e0ea30 refs/pull/1003/merge
669df27c74495bc407577415a6823c662460a38a refs/reviewable/pr2025/r1
298334fffc8288b5a9a45ef4150e3c4292e45318 refs/tags/0.10.1
2.列出远程分支
git ls-remote -h origin
git ls-remote --heads origin
79c71f24e4cb064852e2cbbfef78a0a051eb7ced refs/heads/0.12.x
d92b64aa275841b0c9aea3903aba72fbc4275d91 refs/heads/1.0.x
1ca199f9b38b70a4e97cb47a4252ffd7fccc008c refs/heads/1.1.x
0305d31cb8c62b26c1e073995114963c88ca962e refs/heads/2.0.x
ac1bb97679f2b778bd89580fac2f461ff77c716a refs/heads/2.1.x
bda08b11c692a5c94124b11749c1af6fa5c0e003 refs/heads/2.2.x
f215de030e4bb66205e39c786437b41aa86a5dd6 refs/heads/2.3.x
cb825687a592709f902f3d320d93987a0546fd28 refs/heads/main
3.列出远程分支对应的commit
git ls-remote origin 2.0.x
0305d31cb8c62b26c1e073995114963c88ca962e refs/heads/2.0.x
4.列出远程标签
git ls-remote -t origin
git ls-remote --tags origin
8605cc310d260c3b08160881b09da26c2cc95f8d refs/tags/0.1
3b9574fec988fca790ffe78b64ef30b22dd3386a refs/tags/0.10
298334fffc8288b5a9a45ef4150e3c4292e45318 refs/tags/0.10.1
13e6a01ac86f9b8c0cad692d5e5e8d600674fb6d refs/tags/0.11
d1d82ca8ce7262ad9d27245ce44f86571287810e refs/tags/0.11.1
1042d9d23f3c61f4474aea568a359337cf450fab refs/tags/0.12
5.搜索索引
git ls-remote --refs origin 'refs/pull/*/head'
3dab2f3d419c9b0c506b9029191bd0ebd1a7768e refs/pull/975/head
a8e88bebd1dff6b982d721c781d87888ef756e4a refs/pull/977/head
3614cf8a52f7a024f75b2cf4e5cb018c7f2a9cf9 refs/pull/979/head
19baae3d3445344679b68436322de08b5babf9a1 refs/pull/980/head
...
标签:pull,git,heads,refs,ls,remote
From: https://www.cnblogs.com/lxd670/p/17557172.html