LinuxCommandLibrary

ghq

Manage remote repository clones in a structured directory hierarchy

TLDR

Clone a repository

$ ghq get [https://github.com/owner/repo]
copy
List managed repositories
$ ghq list
copy
List with full paths
$ ghq list -p
copy
Get repository root
$ ghq root
copy
Create new repository
$ ghq create [owner]/[repo]
copy

SYNOPSIS

ghq command [options] [arguments]

DESCRIPTION

ghq manages remote repository clones in a structured directory hierarchy. It clones repositories into organized paths based on their URLs, enabling consistent repository organization across projects.
The tool integrates with shell workflows and fuzzy finders like fzf for quick repository navigation. It supports GitHub, GitLab, Bitbucket, and custom Git hosts.

PARAMETERS

get URL

Clone or sync a repository.
list
List local repositories.
root
Show repository root path.
create NAME
Create a new repository.
-p
Show full paths (list).
--update
Update existing repository.
--shallow
Shallow clone.
--help
Display help information.

CONFIGURATION

~/.gitconfig

Configure repository root path with `ghq.root` setting.
~/.config/ghq/config.toml
Alternative configuration file for setting root paths and Git command options.

CAVEATS

Requires git. Default root is ~/ghq or configurable. URL parsing determines directory structure.

HISTORY

ghq was created by motemen as a tool for organizing Git repositories, inspired by go get's directory structure conventions.

SEE ALSO

git(1), fzf(1), gh(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community