如果我要克隆存储库,git 会自动确定存储库的名称并将其克隆到该目录中。
根据 git 克隆文档:
<directory>
要克隆到的新目录的名称。其中“人性化”的部分 如果没有明确给出
,则使用源存储库 (<directory>
对于repo
和/path/to/repo.git
对于foo
)。克隆成 仅当目录为空时才允许现有目录。host.xz:foo/.git
例如:
git clone https://github.com/root-project/cling
Cloning into 'cling'...
运行后如何得到相同的信息:
cd foo
git init
git fetch --depth 1 https://github.com/root-project/cling
git checkout FETCH_HEAD
或者,换句话说,如何在不克隆存储库并记下创建的目录的情况下获取
foo
的目录 host.xz:foo/.git
?
你需要什么?请解释得更清楚一些