Instructions on setting up cywin to work with ssh.
The git bash terminal is hard to work with. Having the ability to setup and configure cygwin binaries on other terminals is very helpful for development purposes.
- Navigate to
C:\cygwin64\home\<your user>
- Open the
.bashrc
with a text editor - Add the following to the bottom of the
.bashrc
file:
#--------SSH Settings-------------
SSH_ENV=$HOME/.ssh/environment
# start the ssh-agent
function start_agent {
echo "Initializing new SSH agent..."
# spawn ssh-agent
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
/usr/bin/ssh-add
}
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
- Save the file
- Exit cygwin and reopen
- Try to clone a repo using git protocol