Skip to content

Instantly share code, notes, and snippets.

@marsa099
Last active May 9, 2022 06:02
Show Gist options
  • Save marsa099/1e3bdf10f09af7b82213ccb199118316 to your computer and use it in GitHub Desktop.
Save marsa099/1e3bdf10f09af7b82213ccb199118316 to your computer and use it in GitHub Desktop.

In WSL (Ubuntu 18.04) git shows unwanted unstaged changes sometimes. If you perform git diff on the files, you can see that only file permissions have changed, e.g:

old mode 100755  
new mode 100644

Fix:
Add these lines to /etc/wsl.conf:

[automount]
options="metadata"

Then run wsl --terminate <distroname>
Then start WSL again

Sources:
https://www.reddit.com/r/bashonubuntuonwindows/comments/ovmlk3/unable_to_change_permissions_of_a_file_using/ https://stackoverflow.com/questions/1257592/how-do-i-remove-files-saying-old-mode-100755-new-mode-100644-from-unstaged-cha

#wsl #git #filepermissions #chmod #unstaged #changes

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