Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'git status' yields different results in git bash (Windows 10) an WSL2 bash

Tags:

git

bash

I work on Windows 10 with WSL2. I initialized a git repo in git bash (Windows) and everything works fine (commit, push etc.).

git status     # on Windows, git bash

enter image description here

When I switch to WSL2 and have a look at the same status of the same repo (drive mounted in WSL), I find that all files are untracked (WSL2 bash).

git status     # same repo in WSL2 bash

enter image description here

My Questions:

  1. Why does this happen?
  2. Is there a way to avoid this and achieve consistency across both OS (i.e. without cloning into a separate repo in WSL)?
like image 354
Mark Heckmann Avatar asked Jan 25 '26 14:01

Mark Heckmann


1 Answers

you might find some answers here

TLDR : git config --global core.autocrlf true

like image 62
Rigoberta Raviolini Avatar answered Jan 28 '26 05:01

Rigoberta Raviolini



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!