简体   繁体   English

如何在git bash下更改目录

[英]How to change directory under git bash

Could you tell me please how to change directory using git bash? 您能告诉我如何使用git bash更改目录吗?

Exactly I want go to C:/Program Files 确实我要转到C:/Program Files

I type cd c:/ - move to c:/ . 我输入cd c:/ -移至c:/

I type cd Program Files and I get message that "there is no such directory Program". 我键入cd Program Files然后收到消息“没有这样的目录Program”。

So the problem is how to go to the directory name of which consists of two words that are separated by whitespaces. 因此,问题在于如何转到目录名,该目录名由用空格分隔的两个单词组成。

I'm using Windows 7 operating system. 我正在使用Windows 7操作系统。

cd gets just one argument, so if you say cd Program Files it does cd Program . cd仅获得一个参数,因此,如果您说cd Program Files它就执行cd Program So you need to quote Program Files if you want cd to it as just one argument: 因此,如果要将cd仅作为一个参数,则需要引用Program Files

cd "Program Files"

otherwise it is trying to find the directory Program . 否则,它将尝试找到目录Program

您还可以输入空格作为转义序列:

cd /c/Program\ Files/Git/

请在下面找到以在git bash或unix中添加Windows路径

export PATH=$PATH:/c/Program\ Files/Java/jdk1.8.0_221/bin:/c/Program\ Files/apache-maven-3.6.1/bin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM