Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git bash console on windows does not start

Tags:

git

git-bash

While trying to start a git bash window on any folder in my windows 7 machine, the git bash window closes right away.

I do this by clicking on the "Git Bash" option in the context menu.

enter image description here

When I try to start the Git Bash the console window starts temporarily for a few seconds and exits with a 'logout' message.

I tried to go to the Git installed location and run the "Git Bash.lnk" which exits with this message:

D:\DevProgs\Installed\Git-1.7.11\Git>"Git Bash.lnk"
Welcome to Git (version 1.7.11-preview20120710)


Run 'git help git' to display the help index.
Run 'git help <command>' to display help for specific commands.

AD@AYUSMAN /
$ logout

D:\DevProgs\Installed\Git-1.7.11\Git>

Is there something I am doing wrong? I had been able to use Git Bash without any issues on any folder so far.

System Info: Windows 7 64 bit professional edition. Git 1.7.11

like image 640
Ayusman Avatar asked Apr 21 '14 16:04

Ayusman


4 Answers

This suddently started happening for me also. I upgraded to Git version 1.9.5 but nothing changed.

The shortcut was using the following command: "C:\Program Files (x86)\Git\bin\sh.exe" --login -i and exiting with this bad-looking guru meditation:

PS C:\Program Files (x86)\Git\bin> .\sh.exe
0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487
AllocationBase 0x0, BaseAddress 0x68570000, RegionSize 0x460000, State 0x10000
C:\Program Files (x86)\Git\bin\sh.exe:
*** Couldn't reserve space for cygwin's heap, Win32 error 0

So I changed the shortcut to launch Bash instead: "C:\Program Files (x86)\Git\bin\bash.exe" --login -i and all was fixed.

like image 59
Sam Wilson Avatar answered Oct 16 '22 21:10

Sam Wilson


Fixed this by:

  1. Open CMD as Admin
  2. CD to the installation path of GitHub (e.g. CMDPRMPT> CD "C:\Program Files\Git")
  3. Run "git-bash.exe" from command prompt
  4. Right-click the GIT BASH icon on the taskbar and pin it so you can avoid steps 1-3 in the future.

OS Version: Windows 7

GIT version: 2.15.0

Hopefully this helps!

like image 30
amoncadot Avatar answered Oct 16 '22 19:10

amoncadot


Try git v1.8.4 for windows, it works fine to me.
It seems newer version can't use https git push.

like image 1
user218867 Avatar answered Oct 16 '22 20:10

user218867


just open git-Bash.exe as admin this worked for me

like image 1
sanchit verma Avatar answered Oct 16 '22 19:10

sanchit verma