Allow agent forwarding using Cmder (ConEmu)

I am using cmder which runs ConEmu on Windows 8.1.

It has a built in Git functionality so I can pull/push git repositories in the console (like on a Linux console)

  • How can I display my current git branch name in my PowerShell prompt?
  • Retrieving git branch name in prompt or Android gradle: on Jenkins it returns HEAD
  • git log output encoding issues on Windows 10 command prompt
  • Make shell prompt show current head when in a VCS
  • How to start jenkins on different port rather than 8080 using command prompt in Windows?
  • restore windows command prompt tools after git bash replace them with unix tools
  • To authenticate I use a password protected SSH private key. If I do a git push With ConEmu, it will prompt me for the keys password each time. I can type ‘start-ssh-agent’ and enter my password once, and it will will auto-authenticate me in that ConEmu window, however if I close or open another window I need to run the command again.

    How can I start an ssh-agent that will authenticate my key in every ConEmu window?

  • Use local Git repository with a master Subversion repository
  • How to make git grep show at the top instead of the bottom of the terminal screen?
  • Changing repository description in git
  • Rebasing and what does one mean by rebasing pushed commits
  • Using git-shell and restricting developers to commit to their own projects
  • Where to find changes due to `git fetch`
  • One Solution collect form web for “Allow agent forwarding using Cmder (ConEmu)”

    With the following snipped the SSH key is added during the startup of Cmder and the password has only be entered once per session:

    @echo off
    ssh-agent | grep -v echo | sed -e "s/^/@set /" | sed -e "s/;.*$//" - > call.cmd
    call call.cmd
    del call.cmd
    ssh-add "%HOME%\.ssh\id_rsa"
    @echo on

    Add the code to cmder/config/user-startup.cmd in the current Cmder version or to cmder/vendor/init.bat for older versions.

    Git Baby is a git and github fan, let's start git clone.