git log/show etc. replaces the terminal screen

I recently started to use zsh (oh-my-zsh, without customizations) on iTerm2. But, I’m having a trouble in git log or git show.

Previously, for example, the git log results were just a part of the terminal, just like ls -l result. After quitting git log by pressing q key, the result was remained in the terminal screen. I was able to pick some hash id easily.

  • Getting GitHub and Gerrit to play nicely
  • Deleting all Git cached submodules from repository
  • Making Ionic 2 project work after cloning from git
  • Puppet exec command runs in shell, but not via puppet
  • Why are there 2 ways to unstage a file in git?
  • Is there a way to integrate git into the windows cmd or powershell?
  • However, the current problem is that git log (or git show) results replace the screen. So, after quitting git log, the terminal completely removes all git results and returns to the original screen. This behavior is like vim.

    This behavior is the same even with bash or Mac’s default terminal app. This is not a problem of --no-pager.

    Any helps would be appreciated.

  • GitHub for Windows says that there are uncommited changes even though the diffs are empty
  • git hangs macOS Sierra terminal with no recovery
  • Git Install Script How to enter shell command
  • How to manage multiple versions of a project in Git
  • How do I batch delete redundant remote git branches?
  • git author rename not working
  • One Solution collect form web for “git log/show etc. replaces the terminal screen”

    Can you try with:

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

    From “How do I prevent git diff from using a pager?”:

    passing the -F option to less causes it to quit if the content is less than one screen, however after doing so the screen is reset and you end up not seeing the content, the -X option does away with that behaviour.

    Git Baby is a git and github fan, let's start git clone.