Skip to content

Instantly share code, notes, and snippets.

@galaran
galaran / .bash_profile
Last active Dec 16, 2020
Start ssh-agent on opening shell, if not running yet (Git bash environment)
View .bash_profile
# Based on script from Github Help:
# https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/working-with-ssh-key-passphrases#auto-launching-ssh-agent-on-git-for-windows
env=~/.ssh/agent.env
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; }
agent_start () {
(umask 077; ssh-agent >| "$env")
. "$env" >| /dev/null ; }