1

An example.

There is Font Awesome repo https://github.com/FortAwesome/Font-Awesome in GitHub. It has a folder /fonts with a set of fonts in it.

https://github.com/FortAwesome/Font-Awesome/tree/master/fonts

I want to clone only those fonts. I don't need to clone full repository, like it is done normally:

$ git clone git@github.com:FortAwesome/Font-Awesome.git

I'd like to do the following

$ git clone git@github.com:FortAwesome/Font-Awesome.git/tree/master/fonts

But I get error:

$ git clone git@github.com:FortAwesome/Font-Awesome.git/tree/master/fonts
Cloning into 'fonts'...
fatal: remote error:
  FortAwesome/Font-Awesome.git/tree/master/fonts is not a valid repository name
  Email support@github.com for help

Is it possible?

Green
  • 28,742
  • 61
  • 158
  • 247
  • Do you need to `clone` the repository/folder, or just download/copy a particular folder/set of fonts? If the former, could you not clone the whole repo, then delete everything else you don't want? Or do so in a new branch? -- which could be the only branch you store locally. An Interesting question you ask...I'm also curious your use case for this. Perhaps something I'll want sometime;) – SherylHohman Jul 14 '17 at 04:10
  • @SherylHohman, actually, I want to download fonts. And there are six files of fonts in a folder. And there is no option "Download whole folder" in GitHub. Only one file at a time. So I thought if it would be possible to clone the folder. Because currently I really have to clone the whole repo and just delete everything else then. – Green Jul 14 '17 at 09:04
  • Since you are actuall looking to simply download the files, and don't necessarily need to clone the repo, I found this: https://stackoverflow.com/a/38879691/5411817 Basically, 1) goto https://minhaskamal.github.io/DownGit/#/home 2)enter the directory path you want: https://github.com/FortAwesome/Font-Awesome/tree/master/fonts 3) click `Download` --> it downloaded a zip of 6 files (I didn't check beyond that). The repo for this tool is here: https://github.com/MinhasKamal/DownGit – SherylHohman Jul 14 '17 at 18:10

0 Answers0