title: GitHub keeps asking for username/password; BitBucket does not
body: <p>For a while now I have been using BitBucket in Git bash (Mysysgit for Windows). Recently I've added GitHub, but while git stores my BitBucket credentials, it does not for GitHub.</p>
  
  <p>I've tried various things and approaches (amongst <a href="http://blog.glassdiary.com/post/64098582755/setting-up-ssh-for-github-and-bitbucket" rel="nofollow">this tutorial</a> and various SO questions).</p>
  
  <p>Here's what I've done in detail:</p>
  
  <p><strong>1)</strong> Create key pairs for GitHub.</p>
  
  <p><strong>2)</strong> Uploaded the public key to the <code>SSH keys</code> in the GitHub account settings.</p>
  
  <p><strong>3)</strong> Tested both key pairs:</p>
  
  <pre><code>$ ssh -T git@github.com
  Enter passphrase for key '/c/Users/***/.ssh/id_rsa_github':
  Hi ***! You've successfully authenticated, but GitHub does not provide shell access.
  
  $ ssh -T git@bitbucket.org
  logged in as ***.
  You can use git or hg to connect to Bitbucket. Shell access is disabled.
  </code></pre>
  
  <p><strong>4)</strong> Updated my config file with the following:</p>
  
  <pre><code>Host bitbucket.*
   User ***
   IdentityFile ~/.ssh/id_rsa
  
  Host github.*
   HostName github.com
   User ***
   ForwardAgent yes
   IdentityFile ~/.ssh/id_rsa_github
  </code></pre>
  
  <p><strong>5)</strong> Added the private key and passphrase:</p>
  
  <pre><code>$ eval `ssh-agent`
  $ ssh-add ~/.ssh/id_rsa_github
  Enter passphrase for /c/Users/***/.ssh/id_rsa_github:
  Identity added: /c/Users/***/.ssh/id_rsa_github (/c/Users/***/.ssh/id_rsa_github)
  $ ssh-add -L
  ssh-rsa **key here*** /c/Users/***/.ssh/id_rsa_github
  </code></pre>
  
  <p><strong>6)</strong> Added a <code>.bashrc</code> file to autostart the ssh-agent:</p>
  
  <pre><code>eval `ssh-agent`
  </code></pre>
  
  <p>And still:</p>
  
  <pre><code>$ git push origin master
  Username for 'https://github.com':
  </code></pre>
  
  <p>Where am I going wrong?</p>
  
  <hr>
  
  <p><em>Edit:</em> After following the suggestion to switch to SSH, git does not ask my password/username every time. However, now it asks every time for my passphrase. From one git session:</p>
  
  <pre><code>$ git push origin master
  Enter passphrase for key '/c/Users/***/.ssh/id_rsa_github':
  Counting objects: 5, done.
  ***
  
  $ git commit -am "Minor edit"
   1 file changed, 1 insertion(+), 1 deletion(-)
  
  $ git push origin master
  Enter passphrase for key '/c/Users/***/.ssh/id_rsa_github':
  </code></pre>
  
  <p>I've updated my <code>.bashrc</code> file as Github <a href="https://help.github.com/articles/working-with-ssh-key-passphrases" rel="nofollow">suggests it</a>, but as I understand it, it should only ask once for my passphrase. Even if I run mysysgit with administrator privileges, the passphrase is not saved.</p>