Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is "git grep" behaving erratic on my Windows PC?

I'm using Github and Git bash on my Windows PC (running XP).

On Ubuuntu I'm happyily using git grep to plough through my code, but every time I call something like:

git grep "some text in my repo"

on Windows I get the results and afterwards I'm stuck with the bash window showing all kind of things [END], ~, [RETURN]... whenever I try to enter something.

Question:
What else besides CTRL+R, CTRL+Q, FN+END, Q, ESC can I try to not having to force-close and reopen git:bash in order to continue to work.

Thanks!

EDIT:
This is what I mean:

enter image description here

As soon as I start typing, the [END] string re-appears (or 50 lines ~) and I cannot write any command on Git, because whatever is in the way swallows half of what I'm typing.... nice description...

like image 399
frequent Avatar asked Mar 09 '13 22:03

frequent


People also ask

What is grep in git?

Git ships with a command called grep that allows you to easily search through any committed tree, the working directory, or even the index for a string or regular expression.

How do I search git logs?

Simple! Drop the 'log' argument. This will show the commit ID and line number of all instances of your string. (The string can also be a regular expression, which is handy if you know regex, too.)

How do I search git bash?

The Windows Find tool searches for text within a file or files, similar to Unix's grep . You can verify by executing which find . If it points to your Windows folder, it's not the Unix tool. To be sure that you are using the Unix find from the Git Bash shell, type /bin/find .


2 Answers

I was wondering about this also after installing git and running git bash. It seems "git grep" pipes commands through "less".

Solution: Just type q.

like image 169
CasualCoder Avatar answered Oct 13 '22 21:10

CasualCoder


Is git launching less (or something similar) so up/down arrows on your keyboard scrolls through the matches? If you don't want that, try the instructions from https://stackoverflow.com/a/12166923/972216:

set GIT_PAGER=cat

Would disable it for your console session once, or

git config --global core.pager cat

to disable it for your account.

like image 32
Jason Malinowski Avatar answered Oct 13 '22 21:10

Jason Malinowski