0

My experience with git consists of about 4 hours reading github and bitbucket help pages and setting up my local repositories and ssh keys on my computer, so please excuse me if the answer is rather obvious.

I will use 538's github as an example to ask my question.

On my local computer, once I initialize my git folder and have been added to the list of contributors, I know I can download a local copy of the whole folder.

However for example sake, lets say I was only interested in the nba-draft-2015 subdirectory.

From reading How to pull specific directory with git and How to git-pull all but one folder it appears that there is a way to just download the sub directory folder.

Assuming the location or my repo locally is ~/repo, could someone give me what commands I would type into git for this specific example with the 538 data?

I have read the other SO pages and didn't completely understand the links and answers, so I think an example with the 538 page would help best illustrate it for me.

Community
  • 1
  • 1
qwertylpc
  • 2,016
  • 7
  • 24
  • 34
  • possible duplicate of [Is there any way to clone a git repository's sub-directory only?](http://stackoverflow.com/questions/600079/is-there-any-way-to-clone-a-git-repositorys-sub-directory-only) –  Jul 09 '15 at 19:23
  • @OSryx It kind of is a duplicate, but I tried getting it to work, so I was looking for a more concrete example which I could modify for my own use. , rather than people directing me to help pages I've already read and couldn't get to work – qwertylpc Jul 10 '15 at 20:50

2 Answers2

0

Well looking at that repository there are only two files,so if you just wanted those two files you could just download them, or use the steps from your links, this might work too (I could not personally get it working).

I would pull a shallow clone git clone --depth 1 https://github.com/fivethirtyeight/data.git, it only takes a few seconds for me, because it doesn't get all the history, just the most recent change.

However, If you want to be a contributor I don't think you can just pull a part of it, I could be wrong though.

Community
  • 1
  • 1
alexmherrmann
  • 1,055
  • 2
  • 9
  • 17
0

Reading the answer at https://stackoverflow.com/a/2303645/8395964 , seems that it is not possible:

Note that sparse checkouts still require you to download the whole repository, even though some of the files Git downloads won't end up in your working tree.