【问题标题】:Git command - Repository heads not listed while using -h switch with "HEAD" optionGit 命令 - 使用带有“HEAD”选项的 -h 开关时未列出存储库头
【发布时间】:2018-10-12 08:53:51
【问题描述】:

我的局域网中有一个 git 存储库。我尝试通过以下方式查询 Git 以列出所有 HEAD 引用:

方法一

命令

git ls-remote -h username@{ip-address}:/path/to/repo

输出

f0467f266dee55cd32f2ca6fa819814f367db899    HEAD

方法二

命令

git ls-remote username@{ip-address}:/path/to/repo HEAD

输出

f0467f266dee55cd32f2ca6fa819814f367db899    HEAD

方法3

命令

git ls-remote -h username@{ip-address}:/path/to/repo HEAD

使用上述命令时,上面两种方法中列出的头部引用没有列出。

对此有什么想法吗?

【问题讨论】:

    标签: git jenkins github version-control ls-remote


    【解决方案1】:

    我怀疑这是因为HEAD 是一种特殊的引用,它不是分支的头,它不驻留在refs/heads/ 命名空间中。因此,当您要求 git 列出同时具有 -hHEAD 的引用时,git 会发现矛盾并且没有列出任何引用。

    【讨论】:

      猜你喜欢
      • 2021-12-25
      • 2017-07-06
      • 1970-01-01
      • 1970-01-01
      • 2016-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多