Tiny scripts for getting only specific directories from git repositories that was placed on GitHub.
It was designed specially for https://github.com/3F/Examples
Linux & Windows:
ghdir {url_to_directory} [{optional_destination_path}]
Sample:
ghdir https://github.com/3F/Examples/tree/master/DllExport/BasicExportghdir https://github.com/3F/Examples/tree/master/DllExport/BasicExport my/output/dirReceives only this:
└───Examples
└───DllExport
└───BasicExport
├───ClassLibrary1
│ └───Properties
├───ClassLibrary2
│ └───My Project
└───UnmanagedCppConsole
http[s]://github.com/<user>/<project>/tree/<branch>/<path>
It works either through svn client (if you have), or through git (that do you probably have).
It can be also implemented separately from svn/git, for example, through script for msbuild and so on, but... I just have no plan for this.
Today's git does not provide support of receiving data from specific path at all.
While svn export just receives what you need from specific folder, the git will also receive all metadata including history (at least one a tree objects if --depth=1 is used).
Thus, ghdir will always try first with svn. Then, if it's failed by some reason, it will use git clone with --depth=1 key and core.sparseCheckout to filter folders.
just a tip for tortoisesvn:
To extract svn.exe from this msi without installation, use msiextr script:
Now you can use ghdir more efficiently:
...\TortoiseSVN\bin\svn.exe
I hope for some future implementing from GitHub like a button to download specific directory.
And my hope for any ~svn export alternative in official git clients.
hmmm, ...
[ ☕ ]
::