How to update bashrc to auto add ssh credentials for git -
i wondering if there way have bashrc auto add credentials git.
when use git bash have 'ssh-add c:/users/.../... add password after, before start anything.
is there way can set file auto add info? or way in general, bashrc looked place attack not sure.
current bashrc this:
ssh_env="$home/.ssh/environment" # start ssh-agent function start_agent { echo "initializing new ssh agent..." # spawn ssh-agent ssh-agent | sed 's/^echo/#echo/' > "$ssh_env" echo succeeded chmod 600 "$ssh_env" . "$ssh_env" > /dev/null ssh-add } # test identities function test_identities { # test whether standard identities have been added agent ssh-add -l | grep "the agent has no identities" > /dev/null if [ $? -eq 0 ]; ssh-add # $ssh_auth_sock broken start new proper agent if [ $? -eq 2 ];then start_agent fi fi } start_agent
thanks!
Comments
Post a Comment