如何在获取并签出 git 存储库后获取其名称?

问题描述 投票:0回答:1

如果我要克隆存储库,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

git git-clone git-fetch
1个回答
0
投票

你需要什么?请解释得更清楚一些

© www.soinside.com 2019 - 2024. All rights reserved.