我正试图将一个git仓库克隆到一个我知道有写入权限的文件夹中。
我正在尝试使用IntelliJ内置的版本控制功能和来自git-scm.com的git bash程序进行克隆。两者都返回以下错误:
fatal: could not create work tree dir '<repo name>' :
Permission denied
我做错了什么?
我正试图将一个git仓库克隆到一个我知道有写入权限的文件夹中。
我正在尝试使用IntelliJ内置的版本控制功能和来自git-scm.com的git bash程序进行克隆。两者都返回以下错误:
fatal: could not create work tree dir '<repo name>' :
Permission denied
我做错了什么?
使用sudo
sudo git clone <url>
# 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>
一旦您已经克隆了该项目,就在IntelliJ中打开它。
在检查目录权限后(确保您拥有写入权限),请尝试以下步骤:
最初的回答:
cd ~/
mkdir code
cd code
git clone https://github.com/repo-name
首先以管理员身份打开cmd,然后移动到您想要克隆存储库的文件夹,输入克隆命令。
chmod 644 [directory]
和chown user:group [directory]
? - Andreas Louvsudo chmod ...
或者sudo chown <user> ...
- CodeWizard