When using a git command that can have a large amount of output (like git loggit diff, or git blame), Git opens the command output in our terminal "pager"; on most modern Unix-based systems, the default pager will be "less". Learning a few less commands will help us deal with this git command output that opens in the pager. In this lesson, we show some of the most useful of the less commands: q (quit), j (down), k (up), Ctrl f(forward), Ctrl b (backward), /{search} (search), and n/N (next/previous search result).

This lesson only covers some of the most critical less commands; there are more commands available. A good chunk of the commands (and "motions") of the Unix pagers are also used by vi (or vim) and other Unix programs.

One useful tip when we doing `git log` is search term:

git log  // show the git logs
# We can type '/' to enable search and type term behind '/'
/bug // seach for bug in our logs

And also if you want to nav between the search results, you can do:

# type 'n' go to next result
n
# type 'N' go to prev result
Shift + n

[Practical Git] Navigate git command pager output with Unix less commands的更多相关文章

  1. [git] 关闭 git branch 的pager

    高版本的git做了pager的调整. git diff git log git branch 等命令都用了pager, 默认的pager用了less 在我的应用里, 通常branch只有那么3,5个. ...

  2. Fighting regressions with git bisect---within git bisect algorithm

    https://www.kernel.org/pub/software/scm/git/docs/git-bisect-lk2009.html Fighting regressions with gi ...

  3. Git:Git初体验——Git安装配置

    作为即将成为一个程序员的男人,一直在听别人说Git多好多好,之前也随便了解了一些,但是始终没有决心去学会.现在大四了,只有毕设和一门开学六七周只去过一次课的全员必修课外,也没有什么事情做,何不去做这些 ...

  4. git之一: git基础

    参考: SourceTree使用 git教程 廖学风git  文档1 文档2 1. git 概念介绍 工作区: 就是你在电脑里能看到的目录,比如我的learngit文件夹就是一个工作区,工作区下面有. ...

  5. Git Add,Git别名等

    一,Git  Add 1.  git add -A   保存所有的修改 2.  git add .     保存新的添加和修改,但是不包括删除 3.  git add -u   保存修改和删除,但是不 ...

  6. 自定义 Git - 配置 Git

    用git config配置 Git,要做的第一件事就是设置名字和邮箱地址: $ git config --global user.name "John Doe" $ git con ...

  7. Git记录-Git版本控制介绍

    git config命令用于获取并设置存储库或全局选项.这些变量可以控制Git的外观和操作的各个方面. 如果在使用Git时需要帮助,有三种方法可以获得任何git命令的手册页(manpage)帮助信息: ...

  8. Git(三):Git 使用规范流程

    转:http://www.ruanyifeng.com/blog/2015/08/git-use-process.html 团队开发中,遵循一个合理.清晰的Git使用流程,是非常重要的. 否则,每个人 ...

  9. Git命令之回退篇 git revert git reset

    Git command之回退篇 欲练回退 必先了解:HEAD.index.WorkingCopy HEAD: 当前所在的分支版本顶端的别名,也就是最新的一次commit. git commit 之后与 ...

随机推荐

  1. 谈谈数据库中MyISAM与InnoDB区别

    MyISAM:这个是默认类型,它是基于传统的ISAM类型,ISAM是Indexed Sequential Access Method (有索引的顺序访问方法) 的缩写,它是存储记录和文件的标准方法.与 ...

  2. Thread: BooleanRT : Realtime 3D boolean operations for (Runtime,Editor)

    A Product by Mixed Dimensions What is BooleanRT? BooleanRT is a real-time 3D boolean operations exte ...

  3. 【highcharts】

    zoomType positioner

  4. VC++6.0环境下调试c语言代码的方法和步骤_附图

    1.C语言程序四步开发步骤 (1)编辑.可以用任何一种编辑软件将在纸上编写好的C语言程序输入计算机,并将C语言源程序文件*.c以纯文本文件形式保存在计算机的磁盘上(不能设置字体.字号等). (2)编译 ...

  5. Android学习系列(28)--App集成支付宝[已过期]

    手机的在线支付,被认为是2012年最看好的功能,我个人认为这也是移动互联网较传统互联网将会大放光彩的一个功能.人人有手机,人人携带手机,花钱买东西,不再需要取钱付现,不再需要回家上网银,想买什么,扫描 ...

  6. SSL 通信原理及Tomcat SSL 配置

    SSL 通信原理及Tomcat SSL 双向配置 目录1 参考资料 .................................................................. ...

  7. Hackers' Crackdown( UVA UVA 11825状压dp)

    题意:N台电脑,现在有N种服务,现在你可以在每台电脑终止一项服务,他和他相邻的电脑都会被关闭,如果一项服务在所有电脑都没运行,该项服务成功被破坏,问最多能破坏几种服务. 分析:把n个集合分成尽量多组, ...

  8. e2e 自动化集成测试 架构 实例 WebStorm Node.js Mocha WebDriverIO Selenium Step by step (五) 如何让窗体记录登录状态Session

    在写自动化测试的Node.js脚本时, 时常需要测试所写的case, 可能都需要去重新登录一遍,这将相当的耗时, 好在Selenium都借了Session的机制, 如果在最初的浏览器没有关闭的情况下, ...

  9. 【手机走 ipv6】

    树莓 pi 上搭了个 cow 连接美国的 VPS, cow 设置为全局代理. alwaysProxy = true 开机启动 nano /etc/rc.local /usr/local/bin/ssl ...

  10. JavaScript(class0526)

    什么是JavaScript? HTML只是描述网页长相的标记语言,没有计算.判断能力,如果所有计算.判断(比如判断文本框是否为空.判断两次密码是否输入一致)都放到服务器端执行的话网页的话页面会非常慢. ...