Skip to content
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 bash forcing incorrect HOME env #5137

Open
1 task done
ikiris opened this issue Sep 11, 2024 · 3 comments
Open
1 task done

git bash forcing incorrect HOME env #5137

ikiris opened this issue Sep 11, 2024 · 3 comments

Comments

@ikiris
Copy link

ikiris commented Sep 11, 2024

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.46.0.windows.1
cpu: x86_64
built from commit: 2e6a859ffc0471f60f79c1256f766042b0d5d17d
sizeof-long: 4
sizeof-size_t: 8
shell-path: D:/git-sdk-64-build-installers/usr/bin/sh
feature: fsmonitor--daemon
libcurl: 8.9.0
OpenSSL: OpenSSL 3.2.2 4 Jun 2024
zlib: 1.3.1

  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19045.4894]
(c) Microsoft Corporation. All rights reserved.

  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VisualStudioCode
Custom Editor Path:
Default Branch Option: main
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: FFOnly
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Enabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled

  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

env (as seen by git-bash):
MSYSTEM=MINGW64
PATH=
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINDOWS
WINDIR=C:\WINDOWS
TERM=xterm-256color
HOME=/home/ikiris

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other
    git-bash

  • What commands did you run to trigger this issue? If you can provide a
    Minimal, Complete, and Verifiable example
    this will help us understand the issue.

any
  • What did you expect to occur after running these commands?

something has caused git bash to start forcing the HOME env to /home/$USERNAME instead of what it should be at /c/Users/username, and I cannot for the life of me find what is causing it other than just an update broke things at some point. this worked previously.

i can't find an override in any of the profile files etc, and even forcing via export in session cannot override it.
i've tried switching the nssswitch value to windows as well as forcing HOME env via windows.

you can see my real shell envs here from powershell:

ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\ikiris\AppData\Roaming
ChocolateyInstall=C:\ProgramData\chocolatey
ChocolateyLastPathUpdate=133370443822771631
COMMONPROGRAMFILES=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=FEAR
COMSPEC=C:\WINDOWS\system32\cmd.exe
DriverData=C:\Windows\System32\Drivers\DriverData
GOPATH=C:\Users\ikiris\go
HOME=/c/Users/ikiris
HOMEDRIVE=C:
HOMEPATH=\Users\ikiris
LOCALAPPDATA=C:\Users\ikiris\AppData\Local
LOGONSERVER=\SORROW
MSYS2_PATH_TYPE=inherit
NUMBER_OF_PROCESSORS=8
OneDrive=C:\Users\ikiris\OneDrive
OS=Windows_NT
PATH=/c/Program Files/Python312/Scripts:/c/Program Files/Python312:/c/Program Files (x86)/VMware/VMware Player/bin:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/WINDOWS/System32/OpenSSH:/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/c/Program Files/Microsoft VS Code/bin:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/ProgramData/chocolatey/bin:/c/Program Files/OpenSSH-Win64:/c/Program Files/dotnet:/c/Program Files/Graphviz/bin:/c/Program Files/Go/bin:/c/Program Files (x86)/WinSCP:/c/Program Files/TortoiseGit/bin:/c/Program Files/Docker/Docker/resources/bin:/c/Program Files/Git/cmd:/c/Users/ikiris/.cargo/bin:/c/WINDOWS/system32/config/systemprofile/AppData/Local/Microsoft/WindowsApps:/c/WINDOWS/system32/config/systemprofile/go/bin:/c/Program Files/Lens/resources/cli/bin:/ucrt64/bin:/usr/bin:/c/Users/ikiris/go/bin:/c/Users/ikiris/AppData/Local/Keybase
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=5e03
ProgramData=C:\ProgramData
PROGRAMFILES=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\Intel\Wired Networking
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SSH_AGENT_PID=1551
SSH_AUTH_SOCK=C:/Users/ikiris/AppData/Local/Temp/ssh-pXhYgM4D6XcZ/agent.1550
SYSTEMDRIVE=C:
SYSTEMROOT=C:\WINDOWS
TEMP=/c/Users/ikiris/AppData/Local/Temp
TMP=/c/Users/ikiris/AppData/Local/Temp
USERDNSDOMAIN=
USERDOMAIN=
USERDOMAIN_ROAMINGPROFILE=
USERNAME=ikiris
USERPROFILE=C:\Users\ikiris
VAULT_ADDR=
WINDIR=C:\WINDOWS
TERM=xterm-256color

  • What actually happened instead?
    because of the above, none of my config files are being applied, breaking the ability to run git commands via git-bash
@dscho
Copy link
Member

dscho commented Sep 11, 2024

You could try tracing the startup commands (similar to what is suggested on Git for Windows' wiki to diagnose performance issues).

@alejandro5042
Copy link

@ikiris - Not sure if this helps, but have you read this piece of documentation? 6e494ad

@ikiris
Copy link
Author

ikiris commented Nov 26, 2024

The troubleshooting that dealt with the problem was rolling back the git version to one that wasn't broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants