简体   繁体   中英

Git for Windows can`t solve backslash '\' in path address

I have installed Git 2.30, and selected all the default recommended options, but it doesn't seem to be able to access the .gitconfig file at my home directory, as the address has a backslash \ .

The command returns a error message that ignores the \ character, concatenating the following string.

Git Bash 截图

As you can see, it concatenates the directories aidmin (admin user) with git folder, completely ignoring the backslash.

Said error appears on Git Bash, CMD and Powershell.
Should I reinstall with Unix formatting?
Also, unfortunately I can`t install other OS in this machine.

First, 2.3 is old, try and install the latest Git For Windows (2.30.0(2))

Second, check what $HOME looks like.

It should be /c/Users/admim , or, in a CMD, it ( %HOME% ) should be set to %USERPROFILE% .
If not, in your bash session, try for testing to export HOME:

export HOME=/c/Users/admim
git config --global user.name "xxx"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM