具有多个分支的github repo的唯一git url?

2024-04-26 12:47:33 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在看一个flask应用程序,我想将它导入openshift项目(https://github.com/lpolepeddi/intro-to-flask)。它包含一系列“检查点”(分支)作为tut的一部分。我想从https://github.com/lpolepeddi/intro-to-flask/tree/20_visibility_control获取项目起点的最终代码。是为表单的这个分支获取唯一git url的一种方法

https://github.com/lpolepeddi/intro-to-flask.git

这样我就可以用这样的命令把它拉进来:

 git remote add upstream -m master https://github.com/shekhargulati/flask-login-openshift-quickstart.git

Tags: to项目httpsgitgithubcomtree应用程序
1条回答
网友
1楼 · 发布于 2024-04-26 12:47:33

尽管据我所知“单分支GitHub url”并不存在,但您可以克隆整个repo,然后更改分支:

git clone https://github.com/lpolepeddi/intro-to-flask.git
cd intro-to-flask
git checkout 20_visibility_control

或者如this answer中所述,只克隆一个分支:

git clone  branch 20_visibility_control  single-branch https://github.com/lpolepeddi/intro-to-flask.git

相关问题 更多 >