# 使用 Homebrew, MacPorts, Nix 安装 ugit

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

## 安装

```sh
sudo av install brew:ugit
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install ugit
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install ugit
```

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

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#ugit
```

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

## 软件包事实

- **软件包键:** brew:ugit
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/ugit>
- **版本:** 5.9
- **来源摘要:** Undo git commands. Your damage control git buddy
- **主页:** <https://bhupesh.me/undo-your-last-git-mistake-with-ugit/>
- **仓库:** <https://github.com/Bhupesh-V/ugit>
- **上游文档:** <https://bhupesh.me/undo-your-last-git-mistake-with-ugit/>
- **许可证:** MIT
- **源码归档:** <https://github.com/Bhupesh-V/ugit/archive/refs/tags/v5.9.tar.gz>
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- ugit (cli)
- ugit (别名)

## 依赖

- bash
- fzf

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 all

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 5.9
- 本地数据: OK
- 上游仓库: https://github.com/Bhupesh-V/ugit
- 检测到的最新版本: v5.9 (当前)
- 信息: No package-manager update timestamp was available.
## 项目历史与用法

ugit is a shell-oriented Git recovery helper for undoing common accidental Git operations from an interactive terminal workflow.

### 项目历史

The public repository was created in 2021. The upstream README describes ugit as a guided tool for undoing Git mistakes, with support for operations such as commit, add, push, branch deletion, pull, reset, stash, merge, cherry-pick, and file restoration.

The author's project article, published on April 30, 2021, framed ugit as a small tool for beginner-to-intermediate Git users who otherwise lose time searching for recovery commands. The project later continued through tagged releases, including v5.0 in 2021 and v5.9 in 2025.

### 采用历史

ugit's official README documents installation through Homebrew on macOS, an install script on Linux, Docker, shell plugin managers, and manual setup on Windows with Git Bash and fzf. The supplied package data records packaging in Homebrew, MacPorts, and Nix.

The README's news section records early attention in 2021 and 2022, including a Changelog News mention, a GitHub India Constellation talk about Git tooling, and the project passing 1,000 GitHub stars in October 2022.

### 使用方式

ugit is used after a Git mistake to pick a scenario and run the relevant recovery steps. It depends on Bash, Git, fzf, and standard Unix utilities, which makes it fit naturally into interactive shell use rather than IDE-only workflows.

The README also warns that some recovery paths depend on Git reflog retention, so package users may need to tune Git garbage-collection settings if they expect longer undo windows.

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

For package-manager users, ugit is a small example of terminal UX around an existing tool rather than a new VCS. Its value is packaging a set of hard-to-remember Git recovery recipes into a command that can be installed next to fzf, git-extras, and other shell helpers.

### 时间线

- 2021: Public GitHub repository created.
- 2021: Author published the ugit project article and the project appeared on Changelog News.
- 2021: v5.0 release published.
- 2022: README recorded that ugit crossed 1,000 GitHub stars.
- 2025: v5.9 release published.

### Related projects

- The README notes a command-name conflict with git-extras, because both projects can provide a git-undo command.
- ugit is built around Git and fzf and is commonly installed alongside other shell and Git workflow helpers.

### 来源

- <https://api.github.com/repos/Bhupesh-V/ugit>
- <https://api.github.com/repos/Bhupesh-V/ugit/releases?per_page=10>
- <https://bhupesh.me/undo-your-last-git-mistake-with-ugit/>
- <https://github.com/Bhupesh-V/ugit>
- <https://raw.githubusercontent.com/Bhupesh-V/ugit/master/README.md>
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

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

## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** ugit
- **Version Scheme:** 0
- **Revision:** 0
- **Conflicts With:** git-extras
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Nix - ugit: normalized package name match | nixpkgs package indexes: pkgs/by-name/ug/ugit/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - ugit: normalized package name match | MacPorts ports tree: devel/ugit/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [Developer build packages](https://pkg.so/zh-hans/developer-build-tools/) - Matched build, compiler, generator, or developer workflow metadata.
- [fzf](https://pkg.so/zh-hans/brew/fzf/) - Runtime dependency declared by Homebrew.
- [bash](https://pkg.so/zh-hans/brew/bash/) - Runtime dependency declared by Homebrew.
- [gource](https://pkg.so/zh-hans/brew/gource/) - Shares pkgdb curated category or tags: cli, developer-tool, developer-tools, git, version-control.
- [libgit2](https://pkg.so/zh-hans/brew/libgit2/) - Shares pkgdb curated category or tags: cli, developer-tools, git, version-control.
- [git-lfs](https://pkg.so/zh-hans/brew/git-lfs/) - Shares pkgdb curated category or tags: cli, developer-tools, git, version-control.
- [lazygit](https://pkg.so/zh-hans/brew/lazygit/) - Shares pkgdb curated category or tags: cli, developer-tools, git, version-control.
- [git-gui](https://pkg.so/zh-hans/brew/git-gui/) - Shares pkgdb curated category or tags: cli, developer-tools, git, version-control.
- [tig](https://pkg.so/zh-hans/brew/tig/) - Shares pkgdb curated category or tags: cli, developer-tools, git, version-control.
- [hub](https://pkg.so/zh-hans/brew/hub/) - Shares pkgdb curated category or tags: cli, developer-tools, git, version-control.
- [repo](https://pkg.so/zh-hans/brew/repo/) - Shares pkgdb curated category or tags: cli, developer-tools, git, version-control.
- [git-subrepo](https://pkg.so/zh-hans/brew/git-subrepo/) - Local package facts share a topical domain. Shared terms: bash, cli, control, developer, developer-tools.
- [lucky-commit](https://pkg.so/zh-hans/brew/lucky-commit/) - Local package facts share a topical domain. Shared terms: cli, control, developer, developer-tool, developer-tools.

## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
