Skip to content

Instantly share code, notes, and snippets.

@sacsbrainz
Last active August 30, 2023 18:55
Show Gist options
  • Save sacsbrainz/e12f297168b51ef71055e16a7dabc4bf to your computer and use it in GitHub Desktop.
Save sacsbrainz/e12f297168b51ef71055e16a7dabc4bf to your computer and use it in GitHub Desktop.
Git not picking up changes correctly after copy or os change

run this command to see you old and new mode also look out for the last 3 numbers as this represents the permissions

git diff -G.

so after this we can see the issue, our permissions changed

to fix this they are 2 ways

  1. run this command in the root directory of your project and it will fix the permissions

find . -type f -exec chmod a-x {} \;

or reverse back the changes by running this

find . -type f -exec chmod a+x {} \;

  1. run this command to tell git to ignore the permissions issues

git config core.fileMode false

or make it global by doing this

git config --global core.fileMode false

but i will recommend you use option 1

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