Using Git for Windows

Native and full-featured set of Git SCM tools.

Starting shell

Git-for-Windows package provides a lot of msys tools, useful for users used to Unix environment. So, anyone may easily run bash.exe prepared for Git environment.

git-cmd.exe --no-cd --command=usr/bin/bash.exe -l -i

When you start ConEmu first time, it will create a task {Git bash} with similar contents.

Also, you may run in ConEmu tab git-bash.exe, but this is not recommended, because it runs mintty.exe, which is another terminal, actually. And of course, ConEmu can’t change behavior and appearance of ChildGui applications.

Use proper sh.exe from version 2.x

NB Don’t run /bin/sh.exe as your shell (root process) in ConEmu tab! This is just a wrapper for ‘full version’ located in /usr/bin/ folder. That’s why ConEmu will not be able to determine if your tab has running process, or there is a shell only.

Run /usr/bin/sh.exe -l -i to get proper behavior of tab closing confirmation option.

Colorizing fix for Solarized color scheme

Fix for Solarized color scheme.

git config --global "green bold"
git config --global color.status.updated "green bold"
git config --global color.branch.current "green bold"

git config --global color.interactive.prompt "white cyan"
git config --global color.diff.meta "cyan"

Using Far Manager as editor (commit texts). I’m using FarRun to simplify call of far.exe.

git config --global core.editor "farrun -e1:1"

cygwin_exception in less.exe

When updated my git to PortableGit- (obsolete build), bumped into strange exception.

2 [main] less 3872 cygwin_exception::open_stackdumpfile: Dumping stack trace to less.exe.stackdump

The exception actually happens at msys-ncursesw6.dll!664465b1.

After some investigations found how to fix that. The problem was in TERM environment variable, it was set to msys. After removing that variable (clearing it) git’s less begins to work normally.

Git Credential Manager for Windows

As of git 2.x.x, Git Credential Manager for Windows is used as a shell-integrated authentication mechanism supporting both password-only and 2-factor authentication.

In certain cases, terminals like cmd and powershell spawned by ConEmu may encounter problems when running git pull or git push. Git fails with a Win32Exception (“Failed to write credentials”) if the terminal user does not have access to the OS provided credential vault. You can check for such a constellation by running the following command within a ConEmu-spawned powershell terminal.



AuthenticationType : Kerberos
ImpersonationLevel : None
IsAuthenticated    : True
IsGuest            : False
IsSystem           : False
IsAnonymous        : False
Owner              : S-1-5-32-***
User               : S-1-5-21-1801674531-***

If the displayed SIDs for User and Owner differ, you encounter an impersonation problem. git push and git pull can only be run correctly if the two SIDs are equal. The most likely reason is that ConEmu root process was started from startup script or Windows Task Scheduler with different user impersonation than logon user you are trying to use git from. Or you started the ConEmu.exe using ‘Run as administrator’ context menu item from Windows Explorer.

Validate this guess by opening the ConEmu “New console…” window.

If Run as administrator is checked and greyed out / disabled, your terminals will always be spawned with root priviliges, no matter which terminal type you select and thus git will fail to access the credential vault.


More about the problem: