-
-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git can't find %UserProfile%\.gitconfig when running through wslbridge #1654
Comments
How does git-for-windows relates to WSL? |
You may (and probably should?) install git via Anyway, it's a question to wslbridge why only specially defined environment variables are passed to WSL side. You may define them in you task just after |
Git for Windows doesn't really relate to WSL, I just would like to use Git for Windows from a WSL shell since native git on WSL has performance issues. |
@nickbudi have you found any decision yet? In VSCode i can't using git correctly, because of PATH variable changes at ConEmu startup. Without opening ConEmu everything works great. |
@Maximus5 can i use wsl bash without changing PATH like this
some how Git for Windows breaks due to these changes. |
Hello, this one helped me:
|
Repeated from rprichard/wslbridge#32 (comment): @zviryatko |
Repeated from rprichard/wslbridge#32 (comment): Tested with git-for-windows version 2.25.0.windows.1 and wslbridge-0.2.4-cygwin64: C:\Users\username>echo %HOME% %HOME% so HOME is not set in my global environment C:\Users\username>D:\Programs\Git\bin\git.exe config --global -e has opened C:/Users/username/.gitconfig C:\Users\username>D:\ExcludeFromBackup\tmp\wslbridge-0.2.4-cygwin64\wslbridge.exe User@hostname:/mnt/c/Users/username$ echo $HOME /home/User User@hostname:/mnt/c/Users/username$ cmd.exe /c@ echo '%HOME%' D:\ExcludeFromBackup\tmp\home\username Windows Environment variable 'HOME' is set to a different value than WSL internal 'HOME' User@hostname:/mnt/c/Users/username$ /mnt/d/Programs/Git/bin/git.exe config --global -e fatal: cannot create configuration file D:/ExcludeFromBackup/tmp/home/Timo/.gitconfig: No such file or directory git for Windows looks in Windows Environment variable 'HOME' The value of Windows Environment variable Git for Windows checks if SolutionCreate file C:\Users\username>mkdir D:\ExcludeFromBackup\tmp\wslbridge-0.2.4-cygwin64\..\etc\ C:\Users\username>echo db_home: /%H > D:\ExcludeFromBackup\tmp\wslbridge-0.2.4-cygwin64\..\etc\nsswitch.conf
TestC:\Users\username>D:\ExcludeFromBackup\tmp\wslbridge-0.2.4-cygwin64\wslbridge.exe User@hostname:/mnt/c/Users/username$ echo $HOME /home/User User@hostname:/mnt/c/Users/username$ cmd.exe /c@ echo '%HOME%' C:\Users\username User@hostname:/mnt/c/Users/username$ /mnt/d/Programs/Git/bin/git.exe config --global -e has opened C:/Users/username/.gitconfig TLDR - Solution in ConEmu:
Or open admin cmd with ConEmu-variables set in any way. Then:
|
@Maximus5 The way it is currently, the Windows Environment Variable For me the problem wasn't with git for Windows, but with pulseaudio:
|
Note: A proper solution would somehow ensure, that Windows Environment Variable However, I think, that the behavior of the proposed solution is in most situations not problematic: If |
Versions
ConEmu build: 180626 x64 (portable)
OS version: Windows 10 Pro Build 17134 x64
Used shell version: wslbridge + zsh
Problem description
Git for Windows (installed separately) doesn't find .gitconfig in windows user profile when running git through wslbridge, instead looking for the global gitconfig in %ConEmuBaseDirShort%/home/budi/.gitconfig. But running Git for Windows through wsl.exe + zsh works fine.
Steps to reproduce
git.exe config --global --list
Actual results
Expected results
The text was updated successfully, but these errors were encountered: