Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do long results from Git commands kill my PowerShell prompt?

I am using Git Shell (the module for PowerShell) on Windows. It's the one that got installed when I installed Git for Windows. When I run a command that results in a lot of text such as git log I get a page of results and then a ":" at the bottom of the screen. I guess it's a continuation prompt because I press ENTER and get another screen of data. I can't usually recover to a normal prompt after this happens though. I get the text (END) at the bottom of the shell and it looks like it's masking the first few characters of whatever command I try to type and it even seems to act a little sporadic. I can't seem to figure it out. Any ideas?

like image 889
Jeremy Foster Avatar asked Jan 27 '13 21:01

Jeremy Foster


People also ask

Do git commands work in PowerShell?

The "common" recommendation for command-line git on Windows is to use the "git-bash" shell. However, git works nicely from the Windows PowerShell with one small addition...

How do I add Posh to PowerShell in git?

We can do this by either executing the command Add-PoshGitToProfile or by editing your PowerShell profile script and adding the command Import-Module posh-git . If you want posh-git to be available in all your PowerShell hosts (console, ISE, etc) then execute Add-PoshGitToProfile -AllHosts .

How do I prevent git diff from using a pager?

Git uses pager when you run git diff , git show , git grep etc. If you want to see the result without pager, just add --no-pager or -P .

How do I come out of git?

To exit git log, type “q” or “z”. Or type “h” to seek for help.


1 Answers

Several of the git commands use a pager to allow you to view one screen full of information at a time. The one that come with git is usually less (more info). You can visit the link for common commands, but as you've found the most important is q to quit to get back to the command prompt. The next most useful one I've found is space to move to the next screen full.

You can change the pager used if you like in the git config file's core.pager field.

like image 90
David Culp Avatar answered Sep 30 '22 14:09

David Culp