Skip to content

GitHub CLI (gh) extension to clone repositories in a nested directory structure

Notifications You must be signed in to change notification settings

AaronMoat/gh-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

gh clone

gh clone is a gh extension to clone a repository, in my preferred repository structure

Installation

$ gh extension install AaronMoat/gh-clone

Usage & Repository Structure

I like to have a root directory for all repositories, then a sub-directory for each owner:

$ cd /users/me
$ gh clone some-owner/some-repo
First run. Enter the location where you want to clone repositories: /users/me/code
Cloning into '/users/me/code/some-owner/some-repo'...
...
Cloned to /users/me/code/some-owner/some-repo

It will infer the owner from the current directory if not provided:

$ cd /users/me/code/some-owner
$ gh clone some-other-repo
Cloning into some-other-repo
Cloned to /users/me/code/some-owner/some-other-repo

Otherwise, if you're not in an inferrable location, the inferred owner will be yourself:

$ cd /users/me
$ gh clone some-repo
Cloning into some-repo
Cloned to /users/me/code/MyGitHubUsername/some-repo

There is no support for specifying owner syntaxes like git@..., https://..., or git://....

About

GitHub CLI (gh) extension to clone repositories in a nested directory structure

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages