我使用的是Windows8.1 Pro和Git 2.7.1.windows.2。
我的问题是不言而喻的:
xehpuk@XEHPUK MINGW64 /d/the-next-big-thing (develop)
$ git pull
Could not create directory '/%userprofile%/.ssh'.
percent_expand: unknown key %/
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
xehpuk@XEHPUK MINGW64 /d/the-next-big-thing (develop)
$ cd ~
bash: cd: /%userprofile%: No such file or directory
xehpuk@XEHPUK MINGW64 /d/the-next-big-thing (develop)
$ echo $USERPROFILE
C:\Users\xehpuk这在几天前起了作用,我不记得在系统上有什么改变。
显然,我是一个Git初学者和一个主要的Windows用户,如果这是重要的。
我已经通过将用户环境变量GIT_SSH_COMMAND设置为"/c/Program Files/Git/usr/bin/ssh.exe" -i /c/Users/xehpuk/.ssh/id_rsa来解决这个问题。
发布于 2021-09-14 15:18:43
2021年9月,Git for Windows。在试图从Jenkins获取源时,我犯了以下错误:
stderr: vdollar_percent_expand: unknown key %U若要修复,请将环境变量HOME设置为%USERPROFILE%

发布于 2016-02-22 21:13:43
这个问题很容易解决:
只需在windows中的系统属性下设置HOME变量,并将home设置为本地用户配置文件文件夹。

https://stackoverflow.com/questions/35550556
复制相似问题