Search code examples
gitpowershellpowershell-2.0posh-git

PowerShell hangs when git log command is issued


I have installed poshgit and I use PowerShell to run git commands. It works great, except when I issue git log command, I see the following weird behavior :

The command returns with part of the log, I have to keep pressing enter for it to show me the rest of the log. When it reaches the first commit, it says END, but does not return the prompt. If I keep pressing Enter, it just keeps throwing END at me on a new line for every time I hit enter.

I would like git log to return log, and then return a command prompt so I can issue further git commands. Or if you can tell me how to force Powershell to take me to command prompt, that will do just as well. Currently, I am having to kill Powershell each time I issue git log, in order to get the prompt again.

I am on Windows 8.


Solution

  • git log works great for me from powershell.exe. Are you running in the ISE?

    I noticed that 'git log' will pipe its output to less.exe. The ISE will hang when a native command is interactive (like less.exe).

    The workaround is to pipe the output, e.g.:

    git log | out-default
    

    When git notices that output is redirected, it does not pipe the output to a pager.