106

To note, I'm on Oh-My-Zsh and git 2.17. Whenever I type in git branch, instead of showing me the branches of my git, it shows something like this:

~
~
~
~
~
(END)

I can quit this by pressing 'q' on my keyboard, but I'm still confused as to why this is appearing.

GianhTran
  • 3,443
  • 2
  • 22
  • 42
Brian Park
  • 1,245
  • 3
  • 10
  • 15
  • Possible duplicate of [git-branch command behaves like less](https://stackoverflow.com/questions/48341920/git-branch-command-behaves-like-less) – phd Jun 25 '18 at 09:26

4 Answers4

133

Git pipes long output into what's called a pager by default, which can make it easier to view the output if it doesn't fit on a screen. The ~ characters indicate that those lines were not in the original output, but it's showing them so that you can scroll down past the bottom (i.e. the last line of output can go up to the top of the screen).

You typically can use the arrow keys to scroll up or down, and can exit by pressing q.

Gary Mendonca
  • 1,925
  • 1
  • 13
  • 21
56

You can replace the pager with less so it doesn't "scroll" outputs less than the height of the terminal.

git config --global --replace-all core.pager "less -F -X"

I found it from this q. Took a while to find compared to OPs questions, so I figured I'd drop it here in case anyone else has the same issue.

https://stackoverflow.com/a/14118014/4881742

Fred
  • 858
  • 7
  • 14
21

Note that:

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
10

you can use this " git config --global core.pager cat " to change your git configuration to set that as default the problem is sometime when you use or install Oh My Zsh the configuration is change

Riantra
  • 101
  • 1
  • 2
  • Perfect. Oh My Zsh was probably why. It's been one of those things I've just dealt with. Then one day it's, "You know what, I'm fixing this". lol Thanks. – Wade Aug 18 '22 at 03:46
  • worked perfectly, like charm – anandhu Oct 08 '22 at 08:27