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.

  • git is NOT ignoring a symlink
  • Git how to merge master branch of origin repo to master branch of forked repo?
  • How do I go to the next conflict in the Xcode merge tool?
  • Merge status lost when stashing
  • Cannot clone with Git though all permissions have been set up
  • Concurrency in a GIT repo on a network shared folder
  • 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.

  • How to list only auto merged files in git
  • Creating a new minor version between two releases
  • git checkout and git status both say I am up-to-date, but then git pull pulls changes
  • invalid username/password in egit when pushing changes to googlecode
  • Size of a Git repository vs Time
  • Pitfalls when upgrading to a new version of Git
  • 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.