tiistai 5. tammikuuta 2016

Git on windows, ssh agent. Do you hate typing git password?

If you are using git bash for windows it will ask you every single time password when you connect to github or similar. Use commands below in your bash terminal to start ssh-agent and add your key to keyring file. ssh-add will ask your git password for private key but after that it wont ask your password anymore!

eval `ssh-agent -s`
ssh-add
if above doesn't start ssh-agent try:

eval $(ssh-agent)
To start the ssh-agent automatically every single time you open your git bash do the following:

create file named .bashrc with the dot to your user home folder. c:\users\username

to bashrc file type: 

#!/bin/bash
eval `ssh-agent -s`
ssh-add
Then go to your home folder and find hidden .ssh folder. There create file named config
To config file type:

ForwardAgent yes
After this your bash will never ask git password until you close the session.


Originally explained here:
http://stackoverflow.com/questions/17846529/could-not-open-a-connection-to-your-authentication-agent

Ei kommentteja:

Lähetä kommentti