在GIT bash中使用Windows路径样式

rbl8hiat  于 12个月前  发布在  Git
关注(0)|答案(2)|浏览(129)

我在Windows中运行git,并在路径c:\projects中拥有项目
我知道我可以通过命令在GIT bash中访问这个文件夹:

cd /c/projects/

是否有可能以某种方式使GIT理解Windows路径样式,以便有可能运行命令:

cd "c:\projects\"
ttvkxqim

ttvkxqim1#

所有的git bash程序都能识别Windows路径,因为它们运行在Windows之上。发生的事情是反斜杠被git bash解释。只需将它们与白色沿着转义,就可以开始了:

cd C:\\progects\\
vcudknz3

vcudknz32#

现在你可以在Git Bash中包围windows路径了(至少git version 2.26.2.windows.1

cd "c:\projects\"

反之亦然。在Windows cmd中,通常可以使用posix/unix/Linux样式的路径。如果是绝对路径,则只需将驱动器号/c替换为c:

cd "path/to/file"
cd "c:/path/to/file"

相关问题