Suppose my terminal screen is 40 lines high.
Suppose I type in "clear";
Suppose the output if git grep is only 1- lines.
Now, the desired output I want is to have the first 10 lines of my console be the output of git grep.
Instead, git grep fills in a bunch of blank lines and makes my output the bottom ten lines of the screen the output of git grep.
How can I fix this?
Are you looking for a way to have git grep
not show its output through a pager? Try:
GIT_PAGER='' git grep ...
git grep
sends its output through a pager, which you can disable by setting the GIT_PAGER
environment variable. I think what you are seeing is your pager displaying the text at the bottom of the screen, rather than git
doing so. If this is not what you want, we need to know more about what's happening.
Even if the question is a bit old, for further reference, I think the .gitconfig setting should be mentionned, here :
# ~/.gitconfig or .git/config
[pager]
grep = false
This will ensure you never use pager when using git grep
, without the need to add extra env variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With