WSL Ubuntu Distro | How to solve `Operation not permitted` on cloning repository
I am running Ubuntu 18.04, as a Subsystem for Windows. I have done this in mutliple PCs and never had this problem. I try to to git clone <repo>, and I get this:
Cloning into '<repo>'...
error: chmod on /mnt/c/Users/Efsta/Code/<repo>/.git/config.lock failed: Operation not permitted
fatal: could not set 'core.filemode' to 'false'
I tried the following:
❯ git config core.fileMode false, with this result
fatal: not in a git directory❯ git config --global core.filemode false❯ git config --add --global core.filemode false
Nothing seems to work. I already tried a couple of answers here, but WSL seems a little bit more tricky. Anyone have any idea about how to solve this?
I have also tried everything in this question : https://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes, nothing seems to work.
git chmod windows-subsystem-for-linux clone
add a comment |
I am running Ubuntu 18.04, as a Subsystem for Windows. I have done this in mutliple PCs and never had this problem. I try to to git clone <repo>, and I get this:
Cloning into '<repo>'...
error: chmod on /mnt/c/Users/Efsta/Code/<repo>/.git/config.lock failed: Operation not permitted
fatal: could not set 'core.filemode' to 'false'
I tried the following:
❯ git config core.fileMode false, with this result
fatal: not in a git directory❯ git config --global core.filemode false❯ git config --add --global core.filemode false
Nothing seems to work. I already tried a couple of answers here, but WSL seems a little bit more tricky. Anyone have any idea about how to solve this?
I have also tried everything in this question : https://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes, nothing seems to work.
git chmod windows-subsystem-for-linux clone
add a comment |
I am running Ubuntu 18.04, as a Subsystem for Windows. I have done this in mutliple PCs and never had this problem. I try to to git clone <repo>, and I get this:
Cloning into '<repo>'...
error: chmod on /mnt/c/Users/Efsta/Code/<repo>/.git/config.lock failed: Operation not permitted
fatal: could not set 'core.filemode' to 'false'
I tried the following:
❯ git config core.fileMode false, with this result
fatal: not in a git directory❯ git config --global core.filemode false❯ git config --add --global core.filemode false
Nothing seems to work. I already tried a couple of answers here, but WSL seems a little bit more tricky. Anyone have any idea about how to solve this?
I have also tried everything in this question : https://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes, nothing seems to work.
git chmod windows-subsystem-for-linux clone
I am running Ubuntu 18.04, as a Subsystem for Windows. I have done this in mutliple PCs and never had this problem. I try to to git clone <repo>, and I get this:
Cloning into '<repo>'...
error: chmod on /mnt/c/Users/Efsta/Code/<repo>/.git/config.lock failed: Operation not permitted
fatal: could not set 'core.filemode' to 'false'
I tried the following:
❯ git config core.fileMode false, with this result
fatal: not in a git directory❯ git config --global core.filemode false❯ git config --add --global core.filemode false
Nothing seems to work. I already tried a couple of answers here, but WSL seems a little bit more tricky. Anyone have any idea about how to solve this?
I have also tried everything in this question : https://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes, nothing seems to work.
git chmod windows-subsystem-for-linux clone
git chmod windows-subsystem-for-linux clone
edited Feb 4 at 16:31
Dimitris Efst
asked Feb 4 at 16:18
Dimitris EfstDimitris Efst
13
13
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
/mt/c/Users/... is on the Windows NTFS partition itself, and not within the WSL's ext4 formatted system. Therefore you have to treat it as you would an NTFS partition on a USB stick on an actual Ubuntu installation, and accept the limitations of NTFS.
NTFS partitions do not support chmod or similar Linux permissions commands, and unlike in actual Ubuntu instalations which don't error but don't make any permissions changes, WSL doesn't relay this information back to you, it simply errors out as you see here.
You cannot do a git clone sanely into the /mnt/c/... space within WSL because of the Linux permission schemas and chmod not working right. This is a limitation of WSL in its current form.
Ok let me confirm some things. Microsoft says, that I should develop in WSL within Windows, so I can modify them on both the WSL and Windows sides. So, in every other installation I had until now, I did the same. And if we assume that what youa re saying is correct, what would you recommend as a soution to my problem?
– Dimitris Efst
Feb 4 at 16:45
And to add to my above question. What do I do about ssh? Can I resuse the same key on both. There are situations likegcloudwhere I want to use my windows deve enviroment instead...
– Dimitris Efst
Feb 4 at 16:47
Also, previously I was using WLinux, which was slow, but witht the same underlying theory used the Windows filesystem, and I could do it as well. So, not an Ubuntu specific thing.Sorry for spamming you
– Dimitris Efst
Feb 4 at 16:50
add a comment |
I had the same issue. Try this:
sudo umount /mnt/C
sudo mount -t drvfs C: /mnt/C -o metadata
Change the drive letter to whatever one you're having the issue with.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1115564%2fwsl-ubuntu-distro-how-to-solve-operation-not-permitted-on-cloning-repository%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
/mt/c/Users/... is on the Windows NTFS partition itself, and not within the WSL's ext4 formatted system. Therefore you have to treat it as you would an NTFS partition on a USB stick on an actual Ubuntu installation, and accept the limitations of NTFS.
NTFS partitions do not support chmod or similar Linux permissions commands, and unlike in actual Ubuntu instalations which don't error but don't make any permissions changes, WSL doesn't relay this information back to you, it simply errors out as you see here.
You cannot do a git clone sanely into the /mnt/c/... space within WSL because of the Linux permission schemas and chmod not working right. This is a limitation of WSL in its current form.
Ok let me confirm some things. Microsoft says, that I should develop in WSL within Windows, so I can modify them on both the WSL and Windows sides. So, in every other installation I had until now, I did the same. And if we assume that what youa re saying is correct, what would you recommend as a soution to my problem?
– Dimitris Efst
Feb 4 at 16:45
And to add to my above question. What do I do about ssh? Can I resuse the same key on both. There are situations likegcloudwhere I want to use my windows deve enviroment instead...
– Dimitris Efst
Feb 4 at 16:47
Also, previously I was using WLinux, which was slow, but witht the same underlying theory used the Windows filesystem, and I could do it as well. So, not an Ubuntu specific thing.Sorry for spamming you
– Dimitris Efst
Feb 4 at 16:50
add a comment |
/mt/c/Users/... is on the Windows NTFS partition itself, and not within the WSL's ext4 formatted system. Therefore you have to treat it as you would an NTFS partition on a USB stick on an actual Ubuntu installation, and accept the limitations of NTFS.
NTFS partitions do not support chmod or similar Linux permissions commands, and unlike in actual Ubuntu instalations which don't error but don't make any permissions changes, WSL doesn't relay this information back to you, it simply errors out as you see here.
You cannot do a git clone sanely into the /mnt/c/... space within WSL because of the Linux permission schemas and chmod not working right. This is a limitation of WSL in its current form.
Ok let me confirm some things. Microsoft says, that I should develop in WSL within Windows, so I can modify them on both the WSL and Windows sides. So, in every other installation I had until now, I did the same. And if we assume that what youa re saying is correct, what would you recommend as a soution to my problem?
– Dimitris Efst
Feb 4 at 16:45
And to add to my above question. What do I do about ssh? Can I resuse the same key on both. There are situations likegcloudwhere I want to use my windows deve enviroment instead...
– Dimitris Efst
Feb 4 at 16:47
Also, previously I was using WLinux, which was slow, but witht the same underlying theory used the Windows filesystem, and I could do it as well. So, not an Ubuntu specific thing.Sorry for spamming you
– Dimitris Efst
Feb 4 at 16:50
add a comment |
/mt/c/Users/... is on the Windows NTFS partition itself, and not within the WSL's ext4 formatted system. Therefore you have to treat it as you would an NTFS partition on a USB stick on an actual Ubuntu installation, and accept the limitations of NTFS.
NTFS partitions do not support chmod or similar Linux permissions commands, and unlike in actual Ubuntu instalations which don't error but don't make any permissions changes, WSL doesn't relay this information back to you, it simply errors out as you see here.
You cannot do a git clone sanely into the /mnt/c/... space within WSL because of the Linux permission schemas and chmod not working right. This is a limitation of WSL in its current form.
/mt/c/Users/... is on the Windows NTFS partition itself, and not within the WSL's ext4 formatted system. Therefore you have to treat it as you would an NTFS partition on a USB stick on an actual Ubuntu installation, and accept the limitations of NTFS.
NTFS partitions do not support chmod or similar Linux permissions commands, and unlike in actual Ubuntu instalations which don't error but don't make any permissions changes, WSL doesn't relay this information back to you, it simply errors out as you see here.
You cannot do a git clone sanely into the /mnt/c/... space within WSL because of the Linux permission schemas and chmod not working right. This is a limitation of WSL in its current form.
answered Feb 4 at 16:39
Thomas Ward♦Thomas Ward
44.9k23125178
44.9k23125178
Ok let me confirm some things. Microsoft says, that I should develop in WSL within Windows, so I can modify them on both the WSL and Windows sides. So, in every other installation I had until now, I did the same. And if we assume that what youa re saying is correct, what would you recommend as a soution to my problem?
– Dimitris Efst
Feb 4 at 16:45
And to add to my above question. What do I do about ssh? Can I resuse the same key on both. There are situations likegcloudwhere I want to use my windows deve enviroment instead...
– Dimitris Efst
Feb 4 at 16:47
Also, previously I was using WLinux, which was slow, but witht the same underlying theory used the Windows filesystem, and I could do it as well. So, not an Ubuntu specific thing.Sorry for spamming you
– Dimitris Efst
Feb 4 at 16:50
add a comment |
Ok let me confirm some things. Microsoft says, that I should develop in WSL within Windows, so I can modify them on both the WSL and Windows sides. So, in every other installation I had until now, I did the same. And if we assume that what youa re saying is correct, what would you recommend as a soution to my problem?
– Dimitris Efst
Feb 4 at 16:45
And to add to my above question. What do I do about ssh? Can I resuse the same key on both. There are situations likegcloudwhere I want to use my windows deve enviroment instead...
– Dimitris Efst
Feb 4 at 16:47
Also, previously I was using WLinux, which was slow, but witht the same underlying theory used the Windows filesystem, and I could do it as well. So, not an Ubuntu specific thing.Sorry for spamming you
– Dimitris Efst
Feb 4 at 16:50
Ok let me confirm some things. Microsoft says, that I should develop in WSL within Windows, so I can modify them on both the WSL and Windows sides. So, in every other installation I had until now, I did the same. And if we assume that what youa re saying is correct, what would you recommend as a soution to my problem?
– Dimitris Efst
Feb 4 at 16:45
Ok let me confirm some things. Microsoft says, that I should develop in WSL within Windows, so I can modify them on both the WSL and Windows sides. So, in every other installation I had until now, I did the same. And if we assume that what youa re saying is correct, what would you recommend as a soution to my problem?
– Dimitris Efst
Feb 4 at 16:45
And to add to my above question. What do I do about ssh? Can I resuse the same key on both. There are situations like
gcloud where I want to use my windows deve enviroment instead...– Dimitris Efst
Feb 4 at 16:47
And to add to my above question. What do I do about ssh? Can I resuse the same key on both. There are situations like
gcloud where I want to use my windows deve enviroment instead...– Dimitris Efst
Feb 4 at 16:47
Also, previously I was using WLinux, which was slow, but witht the same underlying theory used the Windows filesystem, and I could do it as well. So, not an Ubuntu specific thing.
Sorry for spamming you– Dimitris Efst
Feb 4 at 16:50
Also, previously I was using WLinux, which was slow, but witht the same underlying theory used the Windows filesystem, and I could do it as well. So, not an Ubuntu specific thing.
Sorry for spamming you– Dimitris Efst
Feb 4 at 16:50
add a comment |
I had the same issue. Try this:
sudo umount /mnt/C
sudo mount -t drvfs C: /mnt/C -o metadata
Change the drive letter to whatever one you're having the issue with.
add a comment |
I had the same issue. Try this:
sudo umount /mnt/C
sudo mount -t drvfs C: /mnt/C -o metadata
Change the drive letter to whatever one you're having the issue with.
add a comment |
I had the same issue. Try this:
sudo umount /mnt/C
sudo mount -t drvfs C: /mnt/C -o metadata
Change the drive letter to whatever one you're having the issue with.
I had the same issue. Try this:
sudo umount /mnt/C
sudo mount -t drvfs C: /mnt/C -o metadata
Change the drive letter to whatever one you're having the issue with.
answered Feb 14 at 9:01
Wojtek GrojecWojtek Grojec
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1115564%2fwsl-ubuntu-distro-how-to-solve-operation-not-permitted-on-cloning-repository%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown