Monday 8 December 2014

GitBash as ConEmu task





The current GitBash installs with the shortcut target:


%USERPROFILE%\AppData\Local\GitHub\GitHub.appref-ms --open-shell

The appref-ms file, is a sort of link variant and unsurprisingly, using it as a parameter to ConEmu task command, doesn't work.

To find out what is actually being invoked when when running Git Shell we use Process Explorer  which shows a bash.exe process with the command line :

"%USERPROFILE%\AppData\Local\GitHub\PortableGit_da44d00daa738db527315557813e7b68709ed0a1\bin\bash.exe" --login -i

This looks similar to the standard Cygwin bash invocation, we create a Git task in ConEmu (Win-Alt-P) and use the invocation  with additional parameters to ConEmu specifying a new console and a color scheme:

"%USERPROFILE%\AppData\Local\GitHub\PortableGit_da44d00daa738db527315557813e7b68709ed0a1\bin\bash.exe" --login -i -new_console:P:"^<Tomorrow Night Bright>^"
















and that's it.


2 comments:

  1. Something change in latest github releases: New path is...
    "%USERPROFILE%\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565cb218a521411d0e854079a28c\usr\bin\bash.exe"

    But also change this path is not enough. My solution is:

    cmd /c set PATH=%PATH%;%USERPROFILE%\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565cb218a521411d0e854079a28c\cmd;%USERPROFILE%\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565cb218a521411d0e854079a28c\usr\bin;%USERPROFILE%\AppData\Local\GitHub\PortableGit_c7e0cbde92ba565cb218a521411d0e854079a28c\usr\share\git-tfs; & "C:\Windows\System32\WindowsPowerShell\v1.0\Powershell.exe" -NoExit -ExecutionPolicy Unrestricted -File "%USERPROFILE%\AppData\Local\GitHub\PoshGit_869d4c5159797755bc04749db47b166136e59132\profile.example.ps1" -new_console:P:"^^"

    ReplyDelete
  2. Thanks Michele

    I moved away completely from GitBash, In the context of ConEmu a much better alternative (for me), is Cmder ( http://cmder.net/ ) with integrated msysgit.

    ReplyDelete