Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Bash gets stuck on diff / log, spontaneously repeats same command over and over

Tags:

git

git-bash

I'm having an odd problem with Git Bash on Windows 7 / XP. It used to work fine, but recently I find that after I perform a git diff or git log, Git Bash becomes unusable: following the diff/log, even after I return to the command prompt, Bash keeps suddenly and apparently spontaneously repeating the same command, unprompted and while I'm in the middle of typing a subsequent command.

Has anyone else had this problem? Any advice would be much appreciated, because this is really limiting Git Bash's usefulness at the moment.

like image 201
Nick F Avatar asked Sep 29 '11 14:09

Nick F


1 Answers

You have to use q to quit git's pager. Using Ctrl-C only causes problems on windows.

Ctrl-C should not quit the pager (and it does not on a linux system). When you Ctrl-C on windows (msysgit I suppose?), you are somehow killing the process "from the outside" (i.e. from cmd.exe). I don't know the exact reasons why this happens.

As I've experienced similar problems in the past: try to hit q and Ctrl-C repeatedly in random order, if you're lucky you'll get a working prompt back again ;) [There's no better solution I know of – but it worked for me …]

like image 88
knittl Avatar answered Sep 22 '22 03:09

knittl