I have the following setup:
- WSL installed with Ubuntu, with git already installed there
- git installed from https://git-scm.com on the Windows side
- Symlink creation enabled by turning on Developer Mode and adding my user to the correct policy group, as explained at https://github.com/git-for-windows/git/wiki/Symbolic-Links
core.symlinks=true
(due to above line)core.autocrlf=false
(I don't want git to do any cleverness, I'm sharing the repo between Windows and WSL)
This almost works perfectly (very impressed). When I clone a repository, it is all okay in both Windows and WSL, apart from the symlinks on one of the two sides say they are modified but they are not. On both sides the symlinks work correctly, I can navigate them without issue.
After an initial clone (on the Windows side), Windows PowerShell gives:
PS C:\Users\Matthew\Projects\...> git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
However on the WSL side, it says that the two symlinks are modified:
/mnt/c/Users/Matthew/Projects/...$ git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: t/browser
modified: web/jslib
no changes added to commit
But git diff gives no output:
/mnt/c/Users/Matthew/Projects/...$ git diff
/mnt/c/Users/Matthew/Projects/...$
If I then reset the checkout on the WSL side, it all switches round:
/mnt/c/Users/Matthew/Projects/...$ git reset --hard HEAD
HEAD is now at ......... Commit message here
/mnt/c/Users/Matthew/Projects/...$ git status
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
And back on Windows Powershell:
PS C:\Users\Matthew\Projects\...> git status
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: t/browser
modified: web/jslib
no changes added to commit (use "git add" and/or "git commit -a")
PS C:\Users\Matthew\Projects\...> git diff
PS C:\Users\Matthew\Projects\...>
It seems like git is setting an internal flag that it then considers changed in the other system; is there any way to fix or work around this?