想要下载一个 Git 存储库,我需要什么(Windows 机器)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/110205/
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
Want to download a Git repository, what do I need (windows machine)?
提问by public static
I want to download this open source application, and they are using Git. What do I need to download the code base?
我想下载这个开源应用程序,他们正在使用 Git。下载代码库需要什么?
UpdateHow do I change the working directory when I am using Git Bash? (I want to download the repo at a certain directory, using pwd tells me I will be downloading the repo where I don't want it.
更新当我使用 Git Bash 时如何更改工作目录?(我想在某个目录下载 repo,使用 pwd 告诉我我将下载我不想要的 repo。
回答by Greg Hewgill
回答by James Lawruk
Install mysysgit. (Same as Greg Hewgill's answer.)
安装mysysgit。(与 Greg Hewgill 的回答相同。)
Install Tortoisegit. (Tortoisegit requires mysysgit or something similiar like Cygwin.)
安装Tortoisegit。(Tortoisegit 需要 mysysgit 或类似 Cygwin 的东西。)
After TortoiseGit is installed, right-click on a folder, select Git Clone..., then enter the Url of the repository, then click Ok.
TortoiseGit 安装完成后,右键单击一个文件夹,选择 Git Clone...,然后输入存储库的 Url,然后单击 Ok。
This answer is not any better than just installing mysysgit, but you can avoid the dreaded command line. :)
这个答案并不比仅仅安装 mysysgit 好多少,但是您可以避免使用可怕的命令行。:)
回答by Brent.Longborough
回答by Michael Johnson
To change working directory in GitMSYS's Git Bash you can just use cd
要更改 GitMSYS 的 Git Bash 中的工作目录,您可以使用 cd
cd /path/do/directory
cd /path/do/目录
Note that:
注意:
- Directory separators use the forward-slash (
/
) instead of backslash. - Drives are specified with a lower case letter and no colon, e.g. "
C:\stuff
" should be represented with "/c/stuff
". - Spaces can be escaped with a backslash (
\
) - Command line completion is your friend. Press TAB at anytime to expand stuff, including Git options, branches, tags, and directories.
- 目录分隔符使用正斜杠 (
/
) 而不是反斜杠。 - 驱动器用小写字母而不是冒号指定,例如“
C:\stuff
”应该用“/c/stuff
”表示。 - 空格可以用反斜杠 (
\
)转义 - 命令行完成是你的朋友。随时按 TAB 可展开内容,包括 Git 选项、分支、标签和目录。
Also, you can right click in Windows Explorer on a directory and "Git Bash here".
此外,您可以在 Windows 资源管理器中右键单击目录和“Git Bash here”。