0

I'm learning Git and currently trying to configure it on WSL(v2) - Ubuntu 20.04 on Windows 10. When I execute commands like

git config --global user.name "XX YYY"

It works fine. I set my code editor to Sublime Text (v4) which is NOT installed on WSL, but on Windows. I invoke it using subl.exe --wait and subl.exe is in PATH. When I use subl to edit files from WSL, with subl.exe xyz.txt, everything works and the location is displayed correctly. But I cannot open the .gitconfig file (which is of course, located at WSL home). So when I execute

git config --global -e

to edit the .gitconfig file directly, Sublime Text opens and informs me that the path \\\home\<username>\.gitconfig has become unreachable. I know that in WSL2 the Linux home is mounted at a network location, and maybe this is causing the problem. What can I do to fix this?

amzon-ex
  • 1,645
  • 1
  • 6
  • 28
  • First thing that comes to mind is permissions on the config file. There should be "config" file at /home/username/.git directory. If so make sure you have the correct permissions on that file – Kaus2b Sep 23 '21 at 18:59
  • @KausUntwale The `.gitconfig` file has the permissions **-rw-r--r--**. Which means it's atleast readable for any user, and even if I can't edit it in ST4, I should be able to just open it up, right? – amzon-ex Sep 24 '21 at 04:56
  • yeah thats right, sorry couldnt be of any help. I have windows and red hat running on the same machine, when i create a txt file on linux i have to chmod it in order to edit in windows. So thought that was your issue. Make sure your home and home/user directories have +x for all users as well. – Kaus2b Sep 24 '21 at 18:53

0 Answers0