gpt4 book ai didi

git - 如何让Git克隆到当前目录

转载 作者:IT王子 更新时间:2023-10-29 01:10:39 27 4
gpt4 key购买 nike

我在做:

git clone ssh://user@host.com/home/user/private/repos/project_hub.git ./

我得到:

Fatal: destination path '.' already exists and is not an empty directory.

我知道路径。已经存在。我可以保证该目录是空的。 (我在里面执行 ls 却什么也没看到!)

为了将该项目克隆到当前目录,我在这里缺少什么?

最佳答案

简单地在它旁边放一个点

git clone git@github.com:user/my-project.git .

来自git help clone:

Cloning into an existing directory is only allowed if the directory is empty.

因此请确保该目录为空(使用 ls -a 检查),否则命令将失败。

关于git - 如何让Git克隆到当前目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9864728/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com