无法在终端中显示Git树 [英] Unable to show a Git tree in terminal

查看:239
本文介绍了无法在终端中显示Git树的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

:特别的手工输出。






JakubNarębski 在评论中提及 tig ,git的基于ncurses的文本模式界面。请参见其发布

它添加了 a - graph 选项


Killswitchcollective.com's old article, 30 June 2009, has the following inputs and outputs

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

I am interested how you get the tree like-view of commits in your terminal without using Gitk or Gitx in OS/X.

How can you get the tree-like view of commits in terminal?

解决方案

How can you get the tree-like view of commits in terminal?

git log --graph --oneline --all

is a good start.

You may get some strange letters. They are ASCII codes for colors and structure. To solve this problem add the following to your .bashrc:

export LESS="-R"

such that you do not need use Tig's ASCII filter by

git log --graph --pretty=oneline --abbrev-commit | tig   // Masi needed this 

The article text-based graph from Git-ready contains other options:

git log --graph --pretty=oneline --abbrev-commit

Regarding the article you mention, I would go with Pod's answer: ad-hoc hand-made output.


Jakub Narębski mentions in the comments tig, a ncurses-based text-mode interface for git. See their releases.
It added a --graph option back in 2007.

这篇关于无法在终端中显示Git树的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆