Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/AaronMoat/gh-clone
GitHub CLI (gh) extension to clone repositories in a nested directory structure
https://github.com/AaronMoat/gh-clone
gh-extension
Last synced: 3 months ago
JSON representation
GitHub CLI (gh) extension to clone repositories in a nested directory structure
- Host: GitHub
- URL: https://github.com/AaronMoat/gh-clone
- Owner: AaronMoat
- Created: 2024-07-07T07:48:51.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-07T07:49:01.000Z (6 months ago)
- Last Synced: 2024-07-12T01:41:00.704Z (6 months ago)
- Topics: gh-extension
- Language: Shell
- Homepage:
- Size: 1.95 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# `gh clone`
`gh clone` is a [`gh` extension](https://docs.github.com/en/github-cli/github-cli/using-github-cli-extensions) to clone a repository, in my preferred [repository structure](#usage--repository-structure)
## Installation
```shell
$ 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:
```shell
$ 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:
```shell
$ 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:
```shell
$ 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://...`.