package
Lazy GitHub clone: navigate files in CLI without a clone (tested in macOS).
npm install ghcGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Lazy GitHub clone: navigate files in CLI without a clone (tested in macOS).
I use GitHub a lot and found it painful to browser files (on the web app) and also it's very slow to clone big repos. What I really want is just only download files I need. Octotree is a great extension for Chrome but I'd like to build a tool for CLI.
Ghc is a 2-hour hack. So, if you think it useful and want to help improving, feel free to submit an issue / question / PR. Thanks!
Please ensure you have nodejs >= 6 and npm installed.
$ npm i ghc -g
$ ghc -i <username>/<repository> (master as default branch)
$ ghc -i <username>/<repository> -b <branch>
which will open a customized ghc shell. The shell supports very basic output format, highlight, autocomplete and command history.
$ ls [path]
$ cd <path>
$ cat <file>: download that file (and cat it)
$ subl <file>: download that file (and sublime it)
$ atom <file>: download that file (and atom it)
Exit the ghc shell.
$ exit
Other instructions will fallback to execute in bash. i.e. pwd, tree, clear, etc.
~/temp
❯ ghc -i torvalds/linux
Initializing torvalds/linux#master...
OK
Initializing local cache...
OK
∆ torvalds/linux [master]
> ls
.cocciconfig .get_maintainer.ignore .gitignore
.mailmap COPYING CREDITS
Documentation Kbuild Kconfig
MAINTAINERS Makefile README
REPORTING-BUGS arch block
...
∆ torvalds/linux [master]
> cd kernel
∆
2016, Shu Ding, MIT licensed.
<3
Estimated unpacked size across 26 packages.
6.5 MB
Includes dependencies.
5 direct · 3 outdated
^2.0.3
2.1.2
^1.1.3
6.0.1
^0.7.3
0.10.0
^2.9.0
15.1.0
^1.0.3
1.0.3