Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't clone repository from mounted drive

I am using Windows Subsystem for Linux (WSL) and have a mounted microSD card that I've been able to clone repositories into in the past. Recently, however, I am receiving this error when I try to clone from /mnt/d/:

Cloning into 'your_repo'...
error: chmod on /mnt/d/your_repo/.git/config.lock failed: Operation not permitted
error: chmod on /mnt/d/your_repo/.git/config.lock failed: Operation not permitted
error: chmod on /mnt/d/your_repo/.git/config.lock failed: Operation not permitted
error: chmod on /mnt/d/your_repo/.git/config.lock failed: Operation not permitted
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

If I change into any directory on /mnt/c/ I can clone perfectly fine. When I clone I use SSH if that helps. Thank you.

like image 414
Kurt Maurer Avatar asked Oct 17 '18 02:10

Kurt Maurer


People also ask

How do I clone a remote repository to a local machine?

From your repository page on GitHub, click the green button labeled Clone or download, and in the “Clone with HTTPs” section, copy the URL for your repository. Next, on your local machine, open your bash shell and change your current working directory to the location where you would like to clone your repository.


2 Answers

Considering changes to Chmod/Chown WSL Improvements, you could try, as in WSL issue 3172

sudo umount /mnt/d
sudo mount -t drvfs D: /mnt/d -o metadata
like image 111
VonC Avatar answered Oct 21 '22 02:10

VonC


I saw that error on a fresh WSL Unbuntu install. I could of course not sudo umount /mnt/c, however a reboot and all was well.

like image 40
gojimmypi Avatar answered Oct 21 '22 01:10

gojimmypi