Failed to create directory '/home/username/.ssh'

Git suddenly stopped working for me. (I use Git Bash under Windows 7.) Every time I try to pull or push, it says:

Could not create directory '/home/sigod/.ssh'

My SSH keys located in C:\Users\sigod\.sshand HOMEare set to /c/Users/sigod. What should work in accordance with the different qaru.site/questions/1632917 / ... issues .

If I put the SSH keys in C:\Program Files\Git\home\sigod\.ssh, then Git will work again. But how can I make it work without dirty decisions?

+4
source share
2 answers

GitBash Cygwin ( , MINGW64), linux.

, ssh , git bash :

mkdir ~/.ssh
chown $USER:$USER -R ~/.ssh

stat ~/.ssh, , .

ls ~/.ssh

, .

, , echo ~ echo $HOME.

Linux, ~/.bashrc export HOME=/some/directory

, GitBash Windows, mount

MINGW64 /c $ mount
C:/Program Files/Git on / type ntfs (binary,noacl,auto)
C:/Program Files/Git/usr/bin on /bin type ntfs (binary,noacl,auto)
C:/Users/MyUser/AppData/Local/Temp on /tmp type ntfs (binary,noacl,posix=0,usertemp)
C: on /c type ntfs (binary,noacl,posix=0,user,noumount,auto)
D: on /d type ntfs (binary,noacl,posix=0,user,noumount,auto)

, %HOME% , , . env var linux vars, ~/.bashrc

+1

Git Bash MSYS2, CygWin. :

  • cmd.exe HOME, .

    setx HOME ^%UserProfile^%
    

    HOME =% UserProfile% .

  • git bash , /etc/nsswitch.conf db_home. , :

    a:

    db_home: env windows cygwin desc
    

    b:

    db_home: windows
    
  • git - bash 2 (, git - bash , ).

, CygWin .

0

All Articles