用于Windows的Git Bash显示/预期具有正斜杠的文件路径,无驱动器冒号 [英] Git Bash for Windows showing/expecting file paths with forward-slashes, no drive colon

查看:392
本文介绍了用于Windows的Git Bash显示/预期具有正斜杠的文件路径,无驱动器冒号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了自动下载并安装Git for Windows的Git Extensions,当我使用Git Bash时,它将文件路径显示为/ c / whatever /文件夹,而不是C:\whatever\folder,如果我粘贴在Windows资源管理器的路径中,它会扼杀它,因为它希望在驱动器盘符后有前斜杠和冒号。



以前我自己安装Git for Windows时,它显示正确的斜杠/冒号,但是更限制和更难使用(特别是与复制/粘贴)。

为什么它显示/预计文件路径与斜杠并没有冒号,我该如何解决它?!



http: //imgur.com/vMc7fU6

解决方案

您也可以尝试在从Windows复制的目录路径中添加单引号资源管理器并粘贴在终端提示符中(例如,cd'D:\ Documents \Developer Tools& Docs')。它为我工作。查看以下链接中发布的解决方案:
在Windows路径中传递反斜杠传递给unix程序


I installed Git Extensions which automatically downloaded and installed Git for Windows, and when I use Git Bash, it shows the file path as /c/whatever/folder rather than C:\whatever\folder, and if I paste in a path from Windows Explorer, it chokes on it because it's expecting forward-slashes and no colon after the drive letter.

When I installed Git for Windows by itself previously, it showed the slashes/colon properly, but was much more limiting and harder to use (especially with copy/paste).

Why is it showing/expecting file paths with slashes and no colon, and how do I fix it?!

http://imgur.com/vMc7fU6

解决方案

You could also try adding single quotes in the directory path copied from Windows Explorer and pasted in the Terminal prompt (e.g. cd 'D:\Documents\Developer Tools & Docs'). It worked for me. Check out the solution posted in the following link: Escaping backslash in windows paths passed to unix programs

这篇关于用于Windows的Git Bash显示/预期具有正斜杠的文件路径,无驱动器冒号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆