Why do I have to hit 'Q' at the end of 'git log'?

后端 未结 7 717
挽巷
挽巷 2020-12-12 14:00

Consider:

git log -n 20 --pretty=oneline

I am telling Git that I need to see only the last 20 commits. I hate to hit Q to get ri

7条回答
  •  囚心锁ツ
    2020-12-12 14:39

    Git is automatically paging the output for you, since logs tend to easily overflow a single terminal window size (you're in one of the rare exceptions - a oneline format and a small commit limit). If you don't want this, use:

    git --no-pager log -n 20 --pretty=oneline
    

    Note that this does mean you'll get some ugly wrapping, because the pager was previously turning off wrapping for you (since you could use the cursor keys to scroll left-right).

提交回复
热议问题