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. SGU185 - Two Shortest

    原题地址:http://acm.sgu.ru/problem.php?contest=0&problem=185 题目大意:给出一个无向图,求出从 1 到 n 的两条没有相同边的最短路径(允许 ...

  2. OK335xS davinci mdio driver hacking

    /******************************************************************************* * OK335xS davinci m ...

  3. GRIB格式转换心得(转自博客:http://windforestwing.blog.163.com/blog/static/19545412007103084743804/)

    1.wgrib的使用 在cmd命令行下键入wgrib后即可察看wgrib相关命令参数,简要介绍如下: l        Inventory/diagnostic–output selections 详 ...

  4. SQL Server 触发器:表的特定字段更新时,触发Update触发器

    create trigger TR_MasterTable_Updateon MasterTableafter updateas if update ([Type])--当Type字段被更新时,才会触 ...

  5. 软件测试模型汇总-V模型,W模型,X模型,H模型

    V模型 在软件测试方面,V模型是最广为人知的模型,尽管很多富有实际经验的测试人员还是不太熟悉V模型,或者其它的模型.V模型已存在了很长时间,和瀑布开发模型有着一些共同的特性,由此也和瀑布模型一样地受到 ...

  6. 设计模式_Decorator_装饰模式

    形象例子: Mary过完轮到Sarly过生日,还是不要叫她自己挑了,不然这个月伙食费肯定玩完,拿出我去年在华山顶上照的照片,在背面写上“最好的的礼物,就是爱你的Fita”,再到街上礼品店买了个像框(卖 ...

  7. 最短路径算法Dijkstra和A*

    在设计基于地图的游戏,特别是isometric斜45度视角游戏时,几乎必须要用到最短路径算法.Dijkstra算法是寻找当前最优路径(距离原点最近),如果遇到更短的路径,则修改路径(边松弛). Ast ...

  8. tar常用解包

    (1)常见解压缩包 .tar解包 tar -xvf  xxxx.tar 打包 tar -cvf xxxx .tar.bz2解包 bzip2 -d  xxxx.tar.bz2        #会解压成. ...

  9. ACM2040

    关于亲和数的详细解释如下: http://www.kepu.net.cn/gb/basic/szsx/8/8_83/8_83_1004.htm /* 亲和数 时间限制:2000/1000 MS(JAV ...

  10. 深度学习 CNN CUDA 版本2

    作者:zhxfl 邮箱:zhxfl##mail.ustc.edu.cn 主页:http://www.cnblogs.com/zhxfl/p/4155236.html 第1个版本blog在这里:http ...