1

I'm new to Mac, when I use terminal, I found some commands like git log behaviours different from Linux.

On Linux, they will print result on screen and exit, leave all result on screen and I can see it when I input another command. Screen after running command like this:

$ git log
commit **********
Author: ******
....

$

But on Mac, they will print result to a "new screen", after exit, all result will be cleaned so I can't see the previous result. Screen after running command looks like this:

$ git log
$ 

Result has been cleared form screen.

Can I change some settings to make it behaviours like linux? Thanks.

7
  • From script or interactive? Sep 27, 2015 at 10:22
  • @willWorkForCookies interactive
    – Sunny
    Sep 27, 2015 at 10:40
  • What is $TERM for both?
    – 0942v8653
    Sep 27, 2015 at 11:50
  • Let's focus on git here. If you have similar issues with grep (and the answer you get for git don't help you to solve them), please ask a new question for this.
    – nohillside
    Sep 27, 2015 at 11:52
  • @0942v8653 For linux is xterm, for mac is xterm-256color
    – Sunny
    Sep 27, 2015 at 11:56

1 Answer 1

1

The output of git log is sent to a pager for display, which can be configured via git config (variable name is core.pager). By default, less is used, so you may want to compare the value of $LESS on both systems.

1
  • Thanks! On linux $LESS is not set and on Mac it has been set to -R, means repaint the screen, after put unset LESS to .zshrc this issue solved. BTW, I confuse the grep and git grep, sorry for that.
    – Sunny
    Sep 27, 2015 at 12:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .