git 如何克隆一个 github 项目以在本地运行?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1872113/
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
How do I clone a github project to run locally?
提问by RedNax
I am trying to follow this railscast tutorial for authlogic - and it points to the source here-
我正在尝试按照此 authlogic 的 railscast 教程进行操作 - 它指向此处的源-
I have git installed - how do I replicate the source onto my localhost so that I can follow the tutorial like in the screencast?
我已经安装了 git - 如何将源复制到我的本地主机上,以便我可以按照截屏视频中的教程进行操作?
回答by Thilo
git clone git://github.com/ryanb/railscasts-episodes.git
回答by bstrong
To clone a repository and place it in a specified directory use "git clone [url] [directory]". For example
要克隆存储库并将其放置在指定目录中,请使用“git clone [url] [directory]”。例如
git clone https://github.com/ryanb/railscasts-episodes.git Rails
will create a directory named "Rails" and place it in the new directory. Click herefor more information.
将创建一个名为“Rails”的目录并将其放置在新目录中。单击此处了解更多信息。
回答by Kent Aguilar
You clone a repository with git clone [url]. Like so,
您使用 git clone [url] 克隆一个存储库。像这样,
$ git clone https://github.com/libgit2/libgit2
回答by Saeed
I use @Thiho answer but i get this error:
我使用@Thiho 答案,但出现此错误:
'git' is not recognized as an internal or external command
'git' 不被识别为内部或外部命令
For solving that i use this steps:
为了解决我使用以下步骤:
I add the following paths to PATH:
我将以下路径添加到 PATH:
C:\Program Files\Git\bin\
C:\Program Files\Git\cmd\
C:\Program Files\Git\bin\
C:\Program Files\Git\cmd\
In windows 7:
在 Windows 7 中:
- Right-click "Computer" on the Desktop or Start Menu.
- Select "Properties".
- On the very far left, click the "Advanced system settings" link.
- Click the "Environment Variables" button at the bottom.
- Double-click the "Path" entry under "System variables".
- At the end of "Variable value", insert a ; if there is not already one, and then C:\Program Files\Git\bin\;C:\Program Files\Git\cmd. Do not put a space between ; and the entry.
- 右键单击桌面或开始菜单上的“计算机”。
- 选择“属性”。
- 在最左侧,单击“高级系统设置”链接。
- 单击底部的“环境变量”按钮。
- 双击“系统变量”下的“路径”条目。
- 在“变量值”的末尾,插入一个 ; 如果还没有,则为 C:\Program Files\Git\bin\;C:\Program Files\Git\cmd。之间不要留空格; 和入口。
Finally close and re-open your console.
最后关闭并重新打开您的控制台。