1

I'm looking at a flask app which I would like to import into an openshift project (https://github.com/lpolepeddi/intro-to-flask) . This contains a a series of 'checkpoints'(branches) as part of a tut. I want to grab the final code which is at https://github.com/lpolepeddi/intro-to-flask/tree/20_visibility_control for the starting point of a project . Is the a way to get a unique git url for this branch of the form

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

So that I can pull it in with a command like:

 git remote add upstream -m master https://github.com/shekhargulati/flask-login-openshift-quickstart.git
user1592380
  • 30,233
  • 76
  • 247
  • 468
  • Git doesn't have a concept of "checkpoints". Perhaps you mean branches? – Chris Jan 18 '16 at 20:43
  • Sorry they refer to it as checkpoints in the article and the repo https://github.com/lpolepeddi/intro-to-flask/tree/20_visibility_control but you are right they are branches – user1592380 Jan 18 '16 at 20:49
  • http://stackoverflow.com/questions/3471827/how-do-i-list-all-remote-branches-in-git-1-7 – john mangual Jan 18 '16 at 22:22
  • I understand the desire to clone only a particular branch, but your `git remote…` command confuses me. What are you trying to accomplish with it? – Chris Jan 18 '16 at 22:26

1 Answers1

3

Although as far as I know "single branch GitHub url" doesn't exist, you could just clone entire repo and later change branch:

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

or as stated in this answer, clone only one branch:

git clone --branch 20_visibility_control --single-branch https://github.com/lpolepeddi/intro-to-flask.git
Graham
  • 7,035
  • 17
  • 57
  • 82
pkowalczyk
  • 13,653
  • 5
  • 25
  • 35