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:
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...
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.
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.)
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 .
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.
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.
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