git bash 问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11617433/
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 bash questions
提问by dot
i just downloaded msysgit from http://msysgit.github.com/and am trying to learn how to use it. i also downloaded a copy of the pro git manual from their wiki. In chapter 2 it talks about typing "$ git init" in the project directory to have the system create a .git folder.
我刚刚从http://msysgit.github.com/下载了 msysgit并且正在尝试学习如何使用它。我还从他们的 wiki 下载了一份 pro git 手册。在第 2 章中,它谈到在项目目录中键入“$ git init”以使系统创建一个 .git 文件夹。
i'm just new at unix / linux so you'll have to excuse the simple questions. lets say my project folder is located at : c:\myapp\abc and that's where i want to run the git init command
我只是 unix / linux 的新手,所以你必须原谅这些简单的问题。假设我的项目文件夹位于:c:\myapp\abc,这就是我想运行 git init 命令的地方
i'm not sure how i can change directories into the project folder. when i do an "ls"command from where i'm at, i can tell by the contents in the folder that i'm actually in C:\Program Files (x86)\Git.i've tried "cd /myapp/abc" but it just gives me the message " no such file or directory". i feel like i'm missing something really basic here. my prompt when i open git bash is:
我不确定如何将目录更改为项目文件夹。当我从我所在的位置执行“ls”命令时,我可以通过文件夹中的内容判断我实际上在C:\Program Files (x86)\Git 中。我试过“cd /myapp/abc”,但它只是给我消息“没有这样的文件或目录”。我觉得我在这里错过了一些非常基本的东西。我打开 git bash 时的提示是:
$myname@mypcname /
$myname@mypcname /
maybe i just need a bash tutorial? I've also been playing around with the GIT GUI and i was able to create a new repo in another project folder a but i'd like to be able to follow the manual, which for now, seems to be working the git bash tool thanks.
也许我只需要一个 bash 教程?我也一直在玩 GIT GUI,我能够在另一个项目文件夹中创建一个新的存储库,但我希望能够按照手册进行操作,目前该手册似乎正在使用 git bash 工具谢谢。
回答by mamapitufo
The "Git Bash" terminal will put the root of each drive in /<drive-letter>
, so drive C:\
will be at /c/
, drive E:\
will be at /e/
, etc. Try cd /c/myapp/abc
.
“Git Bash”终端会将每个驱动器的根目录放入/<drive-letter>
,因此驱动器C:\
将位于/c/
,驱动器E:\
将位于/e/
等。尝试cd /c/myapp/abc
。
回答by Bart De Boeck
that should be /mnt/drive-letter in your "Git Bash" terminal
那应该是“Git Bash”终端中的 /mnt/drive-letter