【发布时间】:2020-02-25 01:25:36
【问题描述】:
我知道使用下面的 git 命令可以列出我所有的“远程”分支...
[someone@someone-pc somerepo]$ git ls-remote
Username for 'https://somegit.com': someone
Password for 'https://someone@somegit.com':
From https://somegit.com/somepath/somerepo.git
32b73a94a2ef1be27298a7bbf6670670c9ad4892 HEAD
99cfe797ee2f4cd3fc12ea1aef8dc4ea0f3538c7 refs/heads/a_branch
687332d5e82436d806fea2c22ac5e8772e73b33a refs/heads/b_branch
b1d82987dd87b99c505282cbcdf1d4c4d36be2d2 refs/heads/c_branch
32d4a73e686524e50a92880ddbd744d1363834bb refs/heads/d_branch
097ad2a9a69399996f7e1864436d483b2a85e3c1 refs/heads/e_branch
1e92bb0aa448a840e04928272759a3941774575b refs/heads/f_branch
32b73a94a2ef1be27298a7bbf6670670c9ad4892 refs/heads/master
问题:有没有办法按创建日期列出这些分支?
谢谢! =D
更新:
为了说明,我想要一些像 gitlab 分支列表这样排序的东西......
【问题讨论】:
-
分支没有创建日期。 (提交有两个时间戳,一个分支名称标识一个提交,但显然这不是你要找的。)
-
啊,也许这就是你在找什么。我没有使用 GitLab,但它看起来像是在告诉你分支名称指向的提交的两个时间戳之一的年龄。所以如果现在有人做了一个新的提交并推送到服务器上,新提交的时间将是几秒钟,分支会移动到顶部。
-
@torek 我该怎么做你所描述的?也许使用一些 git 命令甚至是 bash“函数”?谢谢! =D
标签: git github gitlab ls-remote git-ls-remote