Linux command
ghq 命令
网络
复制后可按需替换文件名、目录或参数。
常用示例
Clone a repository
ghq get [https://github.com/owner/repo]
Clone a repository via SSH
ghq get -p [owner/repo]
List managed repositories
ghq list
List with full paths
ghq list -p
Get repository root
ghq root
Create new repository
ghq create [owner]/[repo]
Remove a local repository
ghq rm [owner/repo]
Update an already cloned repository
ghq get -u [owner/repo]
说明
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.
参数
- get _URL_
- Clone a repository. Alias: clone.
- list _query_
- List local repositories, optionally filtered by query.
- root
- Show repository root path.
- create _NAME_
- Create a new repository locally.
- rm _NAME_
- Remove a local repository clone.
- -p
- Clone via SSH (get) or show full paths (list).
- -u, --update
- Update existing repository (pull --ff-only).
- --shallow
- Shallow clone (depth 1, Git only).
- --branch _BRANCH_
- Clone a specific branch.
- --bare
- Perform a bare clone (Git only).
- --no-recursive
- Do not clone git submodules.
- -e, --exact
- Require exact query match (list).
- --dry-run
- Show path without deleting (rm).
- --vcs _VCS_
- Specify VCS backend: git, svn, hg, darcs, fossil, bzr.
- --help
- Display help information.
FAQ
What is the ghq command used for?
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.
How do I run a basic ghq example?
Run `ghq get [https://github.com/owner/repo]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does get _URL_ do in ghq?
Clone a repository. Alias: clone.