Killswitchcollective.com's old article, 30 June 2009 , 具有以下输入和输出
git co master
git merge [your_branch]
git push
upstream A-B-C-D-E A-B-C-D-E-F-G
\ ----> \
your branch C-D-E G
我很感兴趣如何在不使用 OS/X 中的 Gitk 或 Gitx 的情况下在终端中获得类似树状的提交 View 。
如何在终端中获得提交的树状 View ?
最佳答案
如何在终端中获得提交的树状 View ?
git log --graph --oneline --all
是一个好的开始。
您可能会收到一些奇怪的信件。它们是颜色和结构的 ASCII 代码。要解决此问题,请将以下内容添加到您的 .bashrc
:
export LESS="-R"
这样你就不需要使用 Tig 的 ASCII 过滤器
git log --graph --pretty=oneline --abbrev-commit | tig // Masi needed this
文章text-based graph from Git-ready包含其他选项:
git log --graph --pretty=oneline --abbrev-commit
关于你提到的文章,我会选择Pod's answer : 临时手工制作的输出。
Jakub Narębski 在评论中提到 tig ,一个基于 ncurses 的 git 文本模式界面。参见 their releases .
它添加了 a --graph
option回到 2007 年。
关于git - 无法在终端中显示 Git 树,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1064361/