Skip to content

Instantly share code, notes, and snippets.

@peteristhegreat
Last active June 13, 2025 16:50
Show Gist options
  • Save peteristhegreat/c2a83189f6de14fa0038d0a6cfdc65d5 to your computer and use it in GitHub Desktop.
Save peteristhegreat/c2a83189f6de14fa0038d0a6cfdc65d5 to your computer and use it in GitHub Desktop.
WSL gotchas, coding, git environment

Git permission downloads

If you clone a git repo into /mnt/c, then you will get 777 permissions on everything.

SourceTree access to a folder under WSL

SourceTree will complain with:

git log failed with code 128 detected dubious ownership ...

And then a command for getting the specific directory and marking it as safe.

Here's the fix, run this in SourceTree's Terminal (aka git_bash.exe) on the Windows side, not WSL.

git config --global safe.directory '*'

https://stackoverflow.com/questions/73485958/how-to-correct-git-reporting-detected-dubious-ownership-in-repository-withou

Git shows everything has changes in VSCode

Install the WSL extension in VSCode, relaunch the folder appropriately, and done. No more weird git diffs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment