Toshimaru's Blog

Using git without pager

Git uses pager when you run git diff, git show, git grep etc.

If you want to see the result without pager, just add --no-pager or -P.

$ git --no-pager diff
diff --git a/Gemfile b/Gemfile
index b413366f..9d9b8837 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,3 +1,5 @@
+# This is test diff
 source ''

 gem 'jekyll', '~> 4.2'

$ git -P grep Toshimaru
_config.yml:title: "Toshimaru's Blog"
_layouts/default.html:      <link type="application/atom+xml" rel="alternate" href=" git without pager.xml" title="Tag: Using git without pager - Toshimaru's Blog" />
_layouts/default.html:      © Toshimaru


How do I prevent ‘git diff’ from using a pager? - Stack Overflow

Load more