假设我有一个 git 仓库~/dev/company/products/company-common
。我尝试从其他几个文件系统位置执行ls-files
或ls-remote
在该存储库上执行。所有的工作,除了最后一个。最后一个不起作用的原因可能是什么?
(注意我有一个 2 行 bash 提示符):
user@machine:products (~/dev/company/products)
$ git ls-remote company-common HEAD
f25b342b384de1b82cb67b6f530303b4fac37ff0 HEAD
user@machine:products (~/dev/company/products)
$ git ls-remote ../products/company-common HEAD
f25b342b384de1b82cb67b6f530303b4fac37ff0 HEAD
user@machine:products (~/dev/company/products)
$ git ls-remote ../../company/products/company-common HEAD
f25b342b384de1b82cb67b6f530303b4fac37ff0 HEAD
user@machine:products (~/dev/company/products)
$ cd gui
user@machine:gui [master] (~/dev/company/products/gui)
$ git ls-remote ../company-common HEAD
f25b342b384de1b82cb67b6f530303b4fac37ff0 HEAD
user@machine:gui [master] (~/dev/company/products/gui)
$ cd dummy/
user@machine:dummy-application [master] (~/dev/company/products/gui/dummy)
$ git ls-remote ../../company-common HEAD
fatal: '../../company-common' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
所涉及的目录都不是符号链接。我只显示了每个命令的一行输出(最后一个除外)