为什么我必须在git日志结尾处输入q [英] why do I have to hit q at the end of git log

查看:107
本文介绍了为什么我必须在git日志结尾处输入q的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  git log -n 20 --pretty = oneline 

我告诉git我只需要看到最后20次提交。我讨厌打Q来摆脱END。有没有办法让我不必打q。

解决方案

Git会自动为您分页输出,因为日志往往容易溢出一个单一的终端窗口大小(你在一个罕见的例外 - 一个oneline格式和一个小的提交限制)。如果你不想要这个,请使用:

  git --no-pager log -n 20 --pretty = oneline 

请注意,这意味着您会得到一些丑陋的包装,因为该传呼器之前已关闭包装你(因为你可以使用光标键左右滚动)。


git log -n 20 --pretty=oneline

I am telling git that I need to see only last 20 commits. I hate to hit Q to get rid of END. Is there a way out so that I don't have to hit q.

解决方案

Git is automatically paging the output for you, since logs tend to easily overflow a single terminal window size (you're in one of the rare exceptions - a oneline format and a small commit limit). If you don't want this, use:

git --no-pager log -n 20 --pretty=oneline

Note that this does mean you'll get some ugly wrapping, because the pager was previously turning off wrapping for you (since you could use the cursor keys to scroll left-right).

这篇关于为什么我必须在git日志结尾处输入q的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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