我在Windows中运行git,并在路径c:\projects中拥有项目我知道我可以通过命令在GIT bash中访问这个文件夹:
c:\projects
cd /c/projects/
是否有可能以某种方式使GIT理解Windows路径样式,以便有可能运行命令:
cd "c:\projects\"
ttvkxqim1#
所有的git bash程序都能识别Windows路径,因为它们运行在Windows之上。发生的事情是反斜杠被git bash解释。只需将它们与白色沿着转义,就可以开始了:
cd C:\\progects\\
vcudknz32#
现在你可以在Git Bash中包围windows路径了(至少git version 2.26.2.windows.1)
git version 2.26.2.windows.1
反之亦然。在Windows cmd中,通常可以使用posix/unix/Linux样式的路径。如果是绝对路径,则只需将驱动器号/c替换为c:
cmd
/c
c:
cd "path/to/file" cd "c:/path/to/file"
2条答案
按热度按时间ttvkxqim1#
所有的git bash程序都能识别Windows路径,因为它们运行在Windows之上。发生的事情是反斜杠被git bash解释。只需将它们与白色沿着转义,就可以开始了:
vcudknz32#
现在你可以在Git Bash中包围windows路径了(至少
git version 2.26.2.windows.1
)反之亦然。在Windows
cmd
中,通常可以使用posix/unix/Linux样式的路径。如果是绝对路径,则只需将驱动器号/c
替换为c: