# 使用 Homebrew, apk, MacPorts, Nix, pacman, scoop, winget 安装 ghq

查看 ghq 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:ghq
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install ghq
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ghq
```

  证据: MacPorts ports tree: sysutils/ghq/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add ghq
```

  证据: Alpine Linux edge package indexes: ghq from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#ghq
```

  证据: nixpkgs package indexes: pkgs/by-name/gh/ghq/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S ghq
```

  证据: Arch Linux sync databases: ghq from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

### Windows

- Scoop (92%):

```sh
scoop install main/ghq
```

  证据: Scoop official bucket manifest trees: bucket/ghq.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id x-motemen.ghq -e
```

  证据: Windows Package Manager source index: x-motemen.ghq from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:ghq
- **软件包管理器:** Homebrew
- **版本:** 1.10.1
- **来源摘要:** Remote repository management made easy
- **主页:** <https://github.com/x-motemen/ghq>
- **仓库:** <https://github.com/x-motemen/ghq>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- ghq (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 1.10.1
## 项目历史与用法

ghq is a command-line repository manager that gives remote Git and other VCS clones a predictable local directory layout.

### 项目历史

The ghq repository was created in 2013. Its README describes the tool as a way to organize remote repository clones like `go get`: a `ghq get` command places a checkout under a root directory, using the remote URL host and path as the local directory structure.

The project grew from a simple clone-and-list helper into a workspace manager with multiple roots, git-config based settings, support for several VCS backends, repository removal, migration of existing repositories into ghq layout, shallow and partial clone options, shell completions, and Windows packaging.

### 采用历史

ghq has a durable following among developers who keep many open-source and work repositories on one machine. Its official README lists installation paths through Homebrew, Void Linux, GNU Guix, Scoop, Go install, conda, asdf, mise, source build, and release binaries.

### 使用方式

Practitioners use ghq to fetch repositories into `~/ghq` or another configured root, list known checkouts, pipe repository paths into fuzzy finders or editors, remove managed clones, and migrate older working trees into a consistent host/user/project hierarchy.

### 为什么软件包爱好者会关心

Package nerds care about ghq because it turns a developer's source tree into an indexable package-like store. It is small, scriptable, and especially useful when combined with shell functions, fuzzy search, and editor launchers.

### 时间线

- 2013: GitHub repository created.
- 2014: v0.2 published on GitHub Releases.
- 2020: README documents installation through multiple package managers and release binaries.
- 2024: ghq added repository removal support.
- 2026: ghq added migration support for existing repositories and worktree-aware operations.

### Related projects

- ghq is related to `go get` style source layouts, Git configuration, Mercurial and other VCS backends, fuzzy finders, editor launchers, and the community ghq-handbook project.

### 来源

- <https://api.github.com/repos/x-motemen/ghq>
- <https://github.com/x-motemen/ghq>
- <https://github.com/x-motemen/ghq/blob/master/CHANGELOG.md>
- <https://github.com/x-motemen/ghq/blob/master/README.adoc>
- <https://github.com/x-motemen/ghq/releases/tag/v0.2>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.gitconfig
## 其他软件包管理器记录

- Nix - ghq: normalized package name match | nixpkgs package indexes: pkgs/by-name/gh/ghq/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - ghq - 1.8.0-r12: normalized package name match | Alpine Linux edge package indexes: ghq from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | CLI to manage remote repository clones | https://github.com/x-motemen/ghq
- apk - ghq-bash-completion - 1.8.0-r12: normalized package name match | Alpine Linux edge package indexes: ghq-bash-completion from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Bash completions for ghq | https://github.com/x-motemen/ghq
- apk - ghq-doc - 1.8.0-r12: normalized package name match | Alpine Linux edge package indexes: ghq-doc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | CLI to manage remote repository clones (documentation) | https://github.com/x-motemen/ghq
- apk - ghq-fish-completion - 1.8.0-r12: normalized package name match | Alpine Linux edge package indexes: ghq-fish-completion from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Fish completions for ghq | https://github.com/x-motemen/ghq
- apk - ghq-zsh-completion - 1.8.0-r12: normalized package name match | Alpine Linux edge package indexes: ghq-zsh-completion from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | Zsh completions for ghq | https://github.com/x-motemen/ghq
- pacman - ghq - 1.10.1-1: normalized package name match | Arch Linux sync databases: ghq from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Remote repository management made easy | https://github.com/x-motemen/ghq
- MacPorts - ghq: normalized package name match | MacPorts ports tree: sysutils/ghq/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/ghq: normalized package name match | Scoop official bucket manifest trees: bucket/ghq.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1
- winget - x-motemen.ghq: normalized package name match | Windows Package Manager source index: x-motemen.ghq from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/ghq.yml](https://github.com/mxcl/pkgdb/blob/main/combined/ghq.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
