Reputation: 8719
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.
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
Upvotes: 8
Views: 42977
Reputation: 1
Just rename the ".bashrc" (ex: ".bashrc.backup") , in the user folder, solved it for me. this works if the .bashrc file is corrupted, has incorrect settings, or has syntax errors. let me know if it works for you.
Upvotes: 0
Reputation: 160
I had an error where my C:\Program Files\Git\ git-bash.exe
seemingly wouldn't run at all. It would immediately return and not even take -v
to dump the runcoms it loads. But, bash.exe
from C:\Program Files\Git\bin worked fine!
I noticed by total chance that a dumpfile was being created ~\mintty.exe.stackdump and on a hunch realized that my .minttyrc was written to the previous day when I changed a terminal setting. Wiping this file fixed git-bash.exe
's issue. Apparently there's some bug when customizing the Mingw installed with Git for Windows where it will write to a .minttyrc but crash silently on startup if it doesn't like some settings.
Upvotes: 2
Reputation: 4395
That problem, although showing always the same face (git-bash
just not starting), can obviously occur due to many reasons. In my case, none of the other solutions helped; I had re-installed Git for Windows a dozen times to no avail. I was using version 2.42.
During those installations, I had chosen mintty
as terminal, because the alternative cmd
is just not usable IMHO. Finally, I uninstalled Git for Windows again and examined my user profile directory (that Git bash considers to be the home directory). I noticed that there was a .minttyrc
configuration file even after having uninstalled Git for Windows.
After having deleted that file and after having re-installed Git for Windows, git-bash
was working as expected. Obviously, .minttyrc
was damaged to a degree that it prevented mintty
(and hence, git-bash
) from starting.
That also explains why git-bash
may run when started in administrator context, and may not run when started in normal user context: The profile directory is different for each user. Administrator
's home directory may contain a valid .minttyrc
, while another user profile might contain a damaged one.
Bottom line:
When uninstalling (or upgrading) Git for Windows, it may leave damaged .minttyrc
files in users' profile directories (that is, in users' home directories from a bash point of view).
The damage may prevent git-bash
from starting.
Hence, if none of the previous solutions helps, just delete the .minttyrc
file in the profile directory of the user in whose context git-bash.exe
should start; normally, that directory is c:\Users\<username>
.
Note that you do not need to uninstall and re-install Git for Windows to see the effect. Please also note that deleting .minttyrc
will destroy the settings if you already have configured mintty
to your needs. However, that configuration is extremely easy and takes only a few seconds.
Upvotes: 0
Reputation: 41
Fixed this by:
OS Version: Windows 7
GIT version: 2.15.0
Hopefully this helps!
Upvotes: 4
Reputation: 4512
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.
Upvotes: 5
Reputation: 8719
The problem was my Kaspersky antivirus. I had to re-install Git and add the Git exe (and other associated Git executable) to safe list of Kaspersky safe list. It took quitesometime to work, but seems to be working fine now.
Upvotes: 0
Reputation: 24866
Try git v1.8.4 for windows, it works fine to me.
It seems newer version can't use https git push.
Upvotes: 1