Preamble to bullshit

A few days ago, I encountered a more troublesome thing, just weekend time, I do not know whether you like me, on Github reading source, just want to see his SRC directory, of course, on Github reading is very troublesome, all kinds of fast can not use, function jump, global search… And so on. But…

The key comes, very source code the whole project is very large, between github network speed is not good, I have to wait a long time to download the resource down, but I only need to see a folder, this is not a waste of resources? And very affect their pursuit of knowledge of the heart. Right! (Pretend to be serious. I want to study so much, you give me a whole warehouse, but also let me find the corresponding files, really very troublesome.

In order not to duplicate the wheel, I first checked whether the existing plug-in can realize this function. If there is one, I can use it happily, and I don’t need to build another wheel.

Read the hot discussion above zhihu, but I feel that the method is still very troublesome. It was not easy to see the top implementation scheme, but Loading kept waiting, and finally did not realize the scheme he wanted.

How do I download a single folder from GitHub?

Then look at Octotree.

Github – This plugin displays tree-like Github directories and provides individual file downloads. But I need a folder… Single file Github itself provides this functionality. Mentality a little breakdown, looking for a long time to find ah.

Focus on

Ahem, the point. In view of the above research and their own problems, and then masturbated a small tool node.

Github.com/hua1995116/…

How to use, very simple, have node environment good

NPM install git - down - '08 - g global gitdown / / install/https://github.com/hua1995116/webchat/tree/master/config/download a single folderCopy the code

Function (default download to local execution directory)

gitdown url

Replace url with github URL as shown in the following example:

  • Download the entire repository (default master)

gitdown https://github.com/hua1995116/webchat

  • Download the dev branch of a repository

gitdown https://github.com/hua1995116/webchat dev

  • Download a single repository folder

gitdown https://github.com/hua1995116/webchat/tree/master/config

  • Downloading a single file

gitdown https://github.com/hua1995116/webchat/blob/master/config/dev.env.js

conclusion

  • If you feel helpful to you can give my small tools a star(github.com/hua1995116/…)
  • If you think it is useless or you have any suggestions, please issue it to me. I will continue to improve and make sure you are satisfied. (squint)

Focus on