3

can anyone help, i am on windows and git is working with my origin set to github.

Of course everytime i wish to pull / push or anything i need to supply the passphrase of the key for github.

According to what i have read i need to edit either a ~/.profile or ~/.bashrc and enter some text

see https://help.github.com/articles/working-with-ssh-key-passphrases

I have done this many times, i actually entered it in both files but when i open up a new GitBash windows nothing seems to run (i assume something is suppose to run and ask my for my passphrase according to the link above).

So of course every Push or Pull again asks me for the passphrase every single time.

I am obviosly missing something here can anyone help?

Remembering that i am on windows :-) and using gitbash that ships with git for windows.

Thanks in advance

Martin
  • 23,844
  • 55
  • 201
  • 327

3 Answers3

4

Well after a lot of investigation, i found this Remember Password, Git bash under windows

which explains exactly what is needed, its different from linux it appears.

Community
  • 1
  • 1
Martin
  • 23,844
  • 55
  • 201
  • 327
1

This might happen in case You've cloned the repository through the "https" method and now trying to do push/pull the "ssh" way or other way round. See if this would work out for you :

git remote set-url origin git@github.com:your_account/your_repo.git
SpiXel
  • 4,338
  • 1
  • 29
  • 45
  • Hi, no i didn't clone anything, it was an init and i entered my origin like SSH but i don't see why the script wouldn't run anyway, its got nothing to do with the github origin, when entering the bash shell (gitbash for win) the script should run and output something to the screen. – Martin Aug 15 '12 at 21:22
  • @Martin try creating your public/private key pair using this command : ssh-keygen -t rsa -C "yourGithubMail" then add your public key to your account and see if that would work. (this way your specifying the ssh protocol and the type of key ) would be doing exactly things mentioned here: https://help.github.com/articles/generating-ssh-keys hope that helps a bit :) – SpiXel Aug 16 '12 at 05:25
0

On Windows 10 this worked for me

  1. run git bash
  2. touch ~/.profile
  3. start ~/.profile to open .profile
  4. add the following to .profile
#! /bin/bash 
eval `ssh-agent -s` 
ssh-add ~/.ssh/*_rsa

This is based on this answer. The only difference is that .bashrc did not work, instead .profile worked.

Community
  • 1
  • 1
Thoran
  • 8,884
  • 7
  • 41
  • 50