Git clone (download) any sub-directories of any GitHub repository (at any reference) without having to clone the entire repository, with only its GitHub URL.Uses the GitHub API to recursively clone the sub-directories tree and files.
I often find myself wanting to only download a certain directory, path or package of an especially big repo that I'm currently viewing (without even cloning the entire repo at depth 1) and to do so by simply copy & pasting the GitHub URL so that's why. Probably more instances where this might come in handy ;)
The GitHub API imposes a rate limiting of up to 60 requests per hour applies but can be increased to up to 5000 requests per hour using an OAuth token (to get one see https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line).
GitHub clone makes an initial request to fetch repo metadata and then, a request for every subfolder in the repo. The requests to download the files within the folders are not counted against the rate limit so in most cases (i.e. the folder/repo you're trying to clone has less than 60 subfolders) the rate limit should not be a problem.
To clone private repositories you need to supply an OAuth token for an account with access to the private repository (to get one see https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line).
Available on PyPi https://pypi.org/project/github-clone/.
Install the script via pip
:
pip install github-clone
or via pipsi
:
pipsi install github-clone
Uses Python 3.3+
GitHub clone (git.io/ghclone)
Usage:
ghclone <url> [-t | --token=<token>]
ghclone (-h | --help)
ghclone (-v | --version)
Examples:
ghclone https://github.com/HR/Crypter/tree/master/app
ghclone https://github.com/HR/Crypter/tree/dev/app
ghclone https://github.com/HR/Crypter/tree/v3.1.0/build
ghclone https://github.com/HR/Crypter/tree/cbee54dd720bb8aaa3a2111fcec667ca5f700510/build
ghclone https://github.com/HR/Picturesque/tree/master/app/src -t li50d67757gm20556d53f08126215725a698560b
Options:
-h --help Show this screen.
-v --version Show version.
-t --token=<token> Set a GitHub OAuth token (see https://developer.github.com/v3/#rate-limiting).
Copyright (C) 2019-2021 Habib Rehman (https://git.io/HR)
Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
在公司电脑经常会遇到无法从github上 clone 或者下载速度极慢的情况,只需要简单的把 github.com 改为 hub.fastgit.org 然后再clone 就可以了。 比如: git clone https://github.com/opencv/opencv.git git clone https://hub.fastgit.org/opencv/opencv.git
有时候,使用git clone 指令下载代码时显示显示:“ithub.com port 443: 连接超时”。 可以使用gitclone加速,官网URL:https://gitclone.com/ 官方描述,有下面三种方式可以使用: 方法一(替换URL) git clone https://gitclone.com/github.com/tendermint/tendermint.git 方法
Github 仓库 git clone 速度过慢解决方法! 很多时候想从 GitHub 上 clone 一个仓库,都会遇到速度慢的问题,而且经常连接失败,这里给出有效解决方案。 背景 有时会遇到从GitHub上clone项目,速度仅有几十KB,而且经常链接失败,经过我亲测,给出有效的解决方法 fatal: early EOF fatal: the remote end hung up unexpe
欢迎使用Markdown编辑器 Source: https://www.jianshu.com/p/81abd0e5e55e 先clone master 分支 git clone [http://myrepo.xxx.com/project/.git] git branch -a,列出所有分支名称 git branch -a checkout 你想要的分支 // 拉取远程仓库的【uat】
两种方式上传文件到github上的repository: 1. 从github上clone,修改然后再上传 $git clone https://github.com/xxx/test.git $cd test $touch a $git add . $git commit -m "first commit" $git push 2. 直接将本地项目上传至github和 1. 在github上
一,GitHub 镜像: https://github.com.cnpmjs.org/ https://hub.fastgit.org/ 访问上面的镜像网站,网站的内容跟 GitHub 是完整同步的镜像,然后在这个网站里面进行下载克隆等操作。 举个栗子: git clone https://github.com/mikecao/umami.git 替换为 git clone https://git
Git introduces --filter option to git clone command, which filters out large files and objects (such as blobs) to create partial clone of a repo. Clone filters are especially useful for large repo and
描述 (Description) clone( )方法克隆匹配的DOM元素并选择克隆。 这对于将元素的副本移动到DOM中的另一个位置非常有用。 语法 (Syntax) 以下是使用此方法的简单语法 - <i>selector</i>.clone( ) 参数 (Parameters) 以下是此方法使用的所有参数的说明 - NA 例子 (Example) 以下是一个简单的例子,简单地显示了这种方法的用
描述 (Description) 它返回具有相同模型列表的集合的新实例。 语法 (Syntax) collection.clone() 例子 (Example) <!DOCTYPE html> <html> <head> <title>Collection Example</title> <script src = "https://code.jquery.com/
描述 (Description) 模型克隆用于创建模型的深层副本或将一个模型对象复制到另一个对象。 语法 (Syntax) model.clone() 例子 (Example) <!DOCTYPE html> <html> <head> <title> Model Example</title> <script src = "https://code.jquery.
git clone ,能把远程仓库完整地复制一份,放到本地的某个目录的下面。 练习 1,克隆一个远程仓库。我们之前创建了一个公开的远程仓库,也就是任何人都可以把这个仓库内容 clone 到他们自己的电脑上。这里我们假装自己是另外一个人,打开电脑上的命令行工具,进入到桌面上,然后再去 clone 一份自己创建的远程仓库。 cd ~/desktop git clone https://github.c
描述 (Description) clone( bool )方法克隆匹配的DOM Elements及其所有事件处理程序,并选择克隆。 这对于将元素及其事件的副本移动到DOM中的另一个位置非常有用。 语法 (Syntax) 以下是使用此方法的简单语法 - <i>selector</i>.clone( bool ) 参数 (Parameters) 以下是此方法使用的所有参数的说明 - bool -