-1

I want to make a new repository on Github and push my local files into it, so I created one on Githuh.com and then on my project I ran these commands:

git init
git add .
git commit -m "First Commit"
git remote add origin git@github.com:myusername/myreponame.git
git push -u origin master

But then it says: Enter passphrase for key '/c/Users/PV/.ssh/id_rsa:'

And I don't really know what to write here because all the tuts that have seen over net, never reached this message!

So if you know what to write here please let me know, thanks.

phd
  • 82,685
  • 13
  • 120
  • 165
memite7760
  • 69
  • 9
  • 1
    This means you created your private key using a passphrase. You need that passphrase to decrypt your private key, so that it can be used to connect. See also https://stackoverflow.com/questions/10032461/git-keeps-asking-me-for-my-ssh-key-passphrase – Jay Mar 23 '23 at 17:01
  • https://stackoverflow.com/search?q=%5Bgit%5D+Enter+passphrase+for+key+%22%2Fc%2FUsers%22 – phd Mar 23 '23 at 17:39

1 Answers1

2

Before using Git add your key to ssh-agent

Start ssh-agent if not started. Run the following command :

$ eval `ssh-agent -s`

Add your private key using ssh-add

$ ssh-add ~/.ssh/id_rsa_key  
Enter passphrase for /home/user/.ssh/id_rsa_key:  
Identity added: /home/user/.ssh/id_rsa_key   
(/home/user/.ssh/id_rsa_key)  

Check if the key is added:

   $ ssh-add -l  
   /home/user/.ssh/id_rsa_key (RSA)

Now try again by the following command :

git init
git add .
git commit -m "First Commit"
git remote add origin git@github.com:myusername/myreponame.git
git push -u origin master
Dip Ghosh
  • 557
  • 2
  • 16