I\'m using cygwin as my terminal on Windows 7. I have found several suggestions to run ssh-agent in cygwin so I don\'t have to enter my password every time I run a git fetch
The problem is still remain. Seems it is related to the different paths and hasn't been fixed yet. You may consider to use expect as an alternatif to ssh-agent for login with passphrase interaction.
In Linux it use to be installed like this:
$ sudo apt-get update
$ apt-get install --assume-yes --no-install-recommends apt-utils expect
In cygwin you may find it under Tcl
:
Here is a simple step on how to use it.
Create a file, lets locate it and name ~/.expect_push
#!/usr/bin/expect -f
spawn git push origin master
expect "Username for 'https://github.com':"
send "<username>\n";
expect "Password for 'https://<username>@github.com':"
send "<password>\n";
interact
Change the above <username>
and <password>
to your login id with following notes:
<password>
contain the char $
put it as \$
otherwise the authentication will be failed. mypa$$word
then put <password>
as mypa\$\$word
.Create another file ~/.git_push
#!/usr/bin/bash
git remote set-url origin git@github.com:<username>/<repo>.git
git add .
git commit -m "my test commit using expect"
expect ~/.ssh/.expect_push
Make them executable and create symlink in /bin
$ chmod +x ~/.expect_push
$ chmod +x ~/.git_push
$ cd /bin
$ ln -s ~/.git_push push
Then you can push
to the remote without need to fill in username and password or passphrase
$ cd /path/to/your/git/folder
$ push