git status in linux reporting changes in all files


It has happened to me a couple times when using git on bash either natively in one of my laptops or through the Windows Linux subsystem. Note that I use Ubuntu LTS (16 and/or 18).

This becomes more obvious when doing a git status for the same repository using Windows CLI/Powershell and using Bash, especially for projects created in a Windows environment. The symptoms are essentially getting no changes on staging on the Windows environment, but reporting changes on all files on staging on Linux.

This is just because of the differences on how both Operating systems handle line breaks.

Without complex canonicalization of your files, you can simply adjust how git handles line breaks:

git config --global core.autocrlf true

Cheers

Comments (0)

Skip to main content