A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
-bash/zsh: tig command not found # Windows (WSL2) sudo apt-get update sudo apt-get install tig # Debian apt-get install tig # Ubuntu apt-get install tig # Alpine apk add tig # Arch Linux pacman -S tig # Kali Linux apt-get install tig # Fedora dnf install tig # OS X brew install tig # Raspbian apt-get install tig # Dockerfile dockerfile.run/tig # Docker docker run cmd.cat/tig tig
Tig: text-mode interface for Git
Tig 是基于 ncurses 的 git 文本模式界面。它主要用作 Git 存储库浏览器,但也可以帮助暂存更改以进行块级提交,并充当各种 Git 命令输出的分页器。
如果 stdin 是管道,则将忽略任何日志或 diff
选项,并将打开分页器视图以从 stdin 加载数据。分页器模式可用于为各种 Git 命令的输出着色。有关如何为 git-show 的输出着色的示例:
git show | tig
tig [options] [revisions] [--] [paths] tig log [options] [revisions] [--] [paths] tig show [options] [revisions] [--] [paths] tig reflog [options] [revisions] tig blame [options] [rev] [--] path tig grep [options] [pattern] tig refs [options] tig stash [options] tig status tig < [Git command output]
Tig 识别的命令行选项包括所有有效的 git-log 和 git-diff 选项,以及以下子命令和 Tig 特定选项。第一个不以 - 开头的命令行参数被解释为修订规范或路径,并将结束选项解析。所有其他选项都将传递给底层 Git 命令。
show Open diff view using the given git-show(1) options. blame Show given file annotated by commits. Takes zero or more git-blame(1) options. Optionally limited from given revision. status Start up in status view. log Start up in log view, displaying git-log(1) output. reflog Start up in reflog view. refs Start up in refs view. stash Start up in stash view. grep Open the grep view. Supports the same options as git-grep(1). +<number> Show the first view with line <number> visible and selected. -v, --version Show version and exit. -h, --help Show help message and exit. -C <path> Run as if Tig was started in <path> instead of the current working directory.
tig 按时间倒序显示从当前提交开始的提交序列:
tig
tig 显示特定分支的历史记录:
tig branch
tig 显示特定文件或目录的历史记录:
tig path1 path2 ...
tig 显示两个引用(例如分支或标签)之间的区别:
tig base_ref..compared_ref
tig 显示所有分支和存储的提交:
tig --all
tig 从存储视图开始,显示所有已保存的存储:
tig stash
tig 显示来自一个或多个分支的提交:
tig test master
tig 显示子模块版本的变化:
tig --submodule
tig 显示单个文件的更改:
tig -- README
tig 显示特定修订版的 README 文件内容:
tig show tig-0.8:README
tig 显示特定文件的两个日期之间的修订:
tig --after="2005-04-01" --before="2025-04-10" -- README
tig 在 diff 视图中使用单词 diff:
tig --word-diff=plain