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

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

问题描述

我克隆了一个git存储库,但不小心弄乱了.因此,我重新克隆并显示消息:

I cloned a git repository but accidentally messed up. So I re-cloned and the message showed up:

目标路径已经存在,并且不是一个空目录

destination path already exists and is not an empty directory

我尝试删除目标位置名称为mac的Mac中的文件夹,但此操作不起作用.

I've tried deleting folders in my mac with the name of the destination path but it did not work.

我对编码非常陌生,因此不胜感激.

I'm very new to coding so all help would be appreciated.

推荐答案

说明

这很模糊,但我会尽力帮助.

This is pretty vague but I'll do what I can to help.

首先,尽管乍一看似乎令人生畏,但我建议您从命令行(在OSX上称为Terminal)学习如何做事.这是确保您将东西放到真正想要的地方的好方法.

First, while it may seem daunting at first, I suggest you learn how to do things from the command line (called terminal on OSX). This is a great way to make sure you're putting things where you really want to.

您绝对应该使用Google"unix命令"来了解更多信息,但是以下是一些在这种情况下可以提供帮助的重要命令:

You should definitely google 'unix commands' to learn more, but here are a few important commands to help in this situation:

ls-列出当前目录中的所有文件和目录(文件夹)

ls - list all files and directories (folders) in current directory

cd <input directory here without these brackets>-更改目录,或更改您要查找的文件夹

cd <input directory here without these brackets> - change directory, or change the folder you're looking in

mkdir <input directory name without brackets>-新建目录(请注意,创建目录后,必须先进入该目录cd)

mkdir <input directory name without brackets> - Makes a new directory (be careful, you will have to cd into the directory after you make it)

rm -r <input directory name without brackets>-删除目录及其中的所有内容

rm -r <input directory name without brackets> - Removes a directory and everything inside it

git clone <link to repo without brackets>-将存储库克隆到您当前正在浏览的目录中.

git clone <link to repo without brackets> - Clones the repository into the directory you are currently browsing.

答案

因此,在我的计算机上,我将运行以下命令在我的documents文件夹中创建一个名为projects的目录(文件夹),并在其中克隆一个存储库.

So, on my computer, I would run the following commands to create a directory (folder) called projects within my documents folder and clone a repo there.

  1. 打开终端
  2. cd documents(在Mac上不区分大小写)
  3. mkdir projects
  4. cd projects
  5. git clone https://github.com/seanbecker15/wherecanifindit.git
  6. cd wherecanifindit(如果我想进入目录)
  1. Open terminal
  2. cd documents (Not case sensitive on mac)
  3. mkdir projects
  4. cd projects
  5. git clone https://github.com/seanbecker15/wherecanifindit.git
  6. cd wherecanifindit (if I want to go into the directory)

p.s. wherecanifindit只是我的git存储库的名称,而不是命令!

p.s. wherecanifindit is just the name of my git repository, not a command!

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

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