I'm trying to use Git, within a Git Bash terminal-window on MS Windows 8.1
When I enter: $git diff file1
to see the changes in a given file, it then presents me with a :
prompt.
How does one get out of that mode, short of closing the whole terminal-window and starting over again? I tried CTRL-C (many times), etc. very annoying!
Thank you for any advice.
Use ONLY q+enter to exit. It's possible to break out by repeatedly typing q+enter+q+enter+q+enter until the end of time no matter what the console shows.
Diffing is a function that takes two input data sets and outputs the changes between them. git diff is a multi-use Git command that when executed runs a diff function on Git data sources. These data sources can be commits, branches, files and more.
The git diff command returns a list of all the changes in all the files between our last commit and our current repository. If you want to retrieve the changes made to a specific file in a repository, you can specify that file as a third parameter.
To get away from the :
prompt, type q
.
git diff
, like many git commands, pipes its output through a pager by default. The default pager is typically less
, and the less
command uses :
as its default prompt.
You should see the same thing for git log
and so forth.
Type man less
at your shell prompt to learn how to use the less
command. Quick summary:
b
to go back a paged
to go forward half a pageu
to go back half a pagek
and j
) to go up and down a line at a timeq
to quith
for help.You can configure the less
command (see the above mentioned man page for details). You can also configure which pager git
users for commands that produce a lot of output if you'd rather not use less
.
Personally, I have the $GIT_PAGER
environment variable set to cat
, so it effectively doesn't use a pager at all; I pipe it through less
manually if I want to. But you might find it more convenient to let git
do that for you.
To get out of the pager, one can press q.
In fact there are several other commands too, see the list here.
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