git fetch - bash.exe:警告:找不到/tmp,请创建
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33836055/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
git fetch - bash.exe: warning: could not find /tmp, please create
提问by Snowcrash
I'm running git fetch
and am getting this error:
我正在运行git fetch
并收到此错误:
> git fetch
bash.exe: warning: could not find /tmp, please create!
Note that I have already
请注意,我已经
- got a
C:/tmp
- set ENV vars set for TEMP / TMP to
C:/tmp
- read bash.exe: warning: could not find /tmp, please create
- 有一个
C:/tmp
- 为 TEMP / TMP 设置 ENV 变量
C:/tmp
- 读取bash.exe:警告:找不到 /tmp,请创建
Any suggestions why this has suddenly stopped working. It was working yesterday!
为什么这突然停止工作的任何建议。昨天还在用!
Note: I get the same error with both git bash
and Powershell
.
注意:我git bash
和Powershell
.
==== UPDATE
==== 更新
And for completeness here are the env variables as output by Powershell
为了完整起见,这里是 Powershell 输出的 env 变量
> dir env:TEMP
Name Value
---- -----
TEMP C:\tmp\
> dir env:TMP
Name Value
---- -----
TMP C:\tmp\
回答by VonC
This was seen when the path including some non-ascii character (see git-for-windows/git/issues/331
当路径包含一些非 ascii 字符时会看到这一点(请参阅git-for-windows/git/issues/331
Make sure the issue persists with the latest git for windows(unzip PortableGit-2.6.3-64-bit.7z.exeanywhere you want, and add its C:\path\to\PortableGit-2.6.3-64-bit\usr\bin
folder to %PATH%
)
确保使用最新的 Windows git问题仍然存在(将PortableGit-2.6.3-64-bit.7z.exe解压缩到任何您想要的位置,并将其C:\path\to\PortableGit-2.6.3-64-bit\usr\bin
文件夹添加到%PATH%
)
Check if the issue persists when the fetch is done form a regular CMD session (not powershell or bahsh).
检查从常规 CMD 会话(不是 powershell 或 bahsh)完成提取后问题是否仍然存在。
回答by Notalifeform
In my case the TEMP environment (my Computer> Advanced > Environment Variables) Was somehow garbled (git bin was appenend (?))
在我的情况下,TEMP 环境(我的计算机 > 高级 > 环境变量)以某种方式出现乱码(git bin 被追加(?))
Setting it to %USERPROFILE%\AppData\Local\Temp fixed it
将其设置为 %USERPROFILE%\AppData\Local\Temp 修复它