git clone 致命:无法创建工作树目录权限被拒绝

Red*_*eld 4 git bash github intellij-idea

所以我试图从 git 克隆一个存储库,到我知道我有写访问权限的文件夹中。

我正在尝试使用 IntelliJ 的内置 VCS 功能和来自 git-scm.com 的 git bash 程序克隆它,它们都返回以下错误:

fatal: could not create work tree dir '<repo name>' : 
Permission denied
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

sho*_*min 8

使用须藤

sudo git clone <url>
Run Code Online (Sandbox Code Playgroud)


Cod*_*ard 4

这个错误非常简单。您没有给定目录的权限。

您可以做几件事,但最简单的一件事是尝试克隆存储库 vigit bash

# go to any other directory where you have the permissions to write to
cd <some path>

# Check to see if you have permissions:
mkdir dummy

# Now once you have verified that you have write permissions -
# clone the project from the command line
git clone <url>
Run Code Online (Sandbox Code Playgroud)

克隆项目后 - 在 IntelliJ 中打开它。