如何让Git克隆进当前目录 [英] How to get Git to clone into current directory
问题描述
我在做:
git clone ssh://user@host.com/home/user/private/ repos / project_hub.git ./
我得到了:
致命:目标路径'。'已经存在并且不是空的
目录。
我知道路径。已经存在。
我可以保证该目录是空的。 (我在里面,我什么都看不到!)
为了将该项目克隆到当前目录中,我在这里丢失了什么? 解决方案:
在这种情况下,解决方案使用点
,
所以: rm -rf。*&& git clone ssh://user@host.com/home/user/private/repos/project_hub.git。
rm -rf。*&&
如果我们完全确定该目录是空的,则可以省略。
:
@James McLaughlin评论如下。
I'm doing:
git clone ssh://user@host.com/home/user/private/repos/project_hub.git ./
I'm getting:
Fatal: destination path '.' already exists and is not an empty directory.
I know path . already exists. And I can assure that directory IS empty. (I do ls inside and I see nothing!)
What am I missing here in order to clone that project into the current directory ?
Solution:
On this case, the solution was using the dot
,
so: rm -rf .* && git clone ssh://user@host.com/home/user/private/repos/project_hub.git .
rm -rf .* &&
may be omitted if we are absolutely sure that the directory is empty.
Credits go to: @James McLaughlin on comments below.
这篇关于如何让Git克隆进当前目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!