Git tutorial: Understanding git pull and branches (using a specific example repo)

Posted by dreftymac on Stack Overflow See other posts from Stack Overflow or by dreftymac
Published on 2010-05-10T23:22:36Z Indexed on 2010/05/10 23:24 UTC
Read the original article Hit count: 359

Filed under:
|
|

Backround:

Suppose I have the following Git URLs (hosted on github)

http://github.com/mikl/drupal.git
git://github.com/mikl/drupal.git  (Git read-only)

I am interested in having a local copy of this repository so I can pratice working with branches in git and see how my local working tree can change depending on which branch I am working with.

Questions:

  1. To get started, I set up a local directory and do git clone git://github.com/mikl/drupal.git ... Will this clone all of the branches? Or will it only clone master?
  2. The web front-end for github gives me a "drop down" menu that allows me to switch branches ... Does changing this drop-down actually change which branch I will be grabbing when I run git clone?
  3. If I want a new copy of this repository on my local machine, but I am interested in only two branches of this repository and I want to ignore all the rest, what command do I use to ensure I clone only those two branches and nothing else (assume one of the branches is master)?

© Stack Overflow or respective owner

Related posts about git

Related posts about tutorial