致命:目标路径'opencv_contrib'已经存在,并且不是空目录 [英] Fatal: destination path 'opencv_contrib' already exists and is not an empty directory

查看:566
本文介绍了致命:目标路径'opencv_contrib'已经存在,并且不是空目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我尝试使用以下命令获取opencv_contrib:

So I tried to get opencv_contrib using :

$ git clone https://github.com/Itseez/opencv_contrib

哪个给了我以下错误:

致命:目标路径'opencv_contrib'已经存在,并且不是空目录.

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

我试图检查目录内容:

$ ls -a

$ ls -a

这就是我得到的:

对所有这些都是新手,我真的无法理解哪里出了问题以及需要做什么.主要是我需要知道如何使所需目录为空,以便继续安装.

Being new to all this, I really am unable to understand what's wrong and what needs to be done. Mainly I need to know how do I make the required directory empty so I can continue with the installation.

推荐答案

检查opencv_contrib是否已经是Git仓库:

Check if opencv_contrib is already a Git repo:

cd opencv_contrib
git status

如果是,则git pull(假设它仍在master上)应该将其更新.

If it is, a git pull (assuming it's still on master) should bring it up-to-date.

如果它不是Git仓库,并且您确定不需要它,只需删除目录并重试:

If it's not a Git repo, and you're sure you don't need what's in it, just remove the directory and try again:

cd ..
rm -rf opencv_contrib/

这篇关于致命:目标路径'opencv_contrib'已经存在,并且不是空目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆