How to solve Permission denied publickey error when using Git

0 votes

Hi Guys,

I'm using a Mac System. I just installed git and tried to clone one repository.

$ git clone git@xxxxxxxxxxxxx.git

But it is showing me the below error.

Initialized empty Git repository in `/Users/username/Documents/cakebook/.git/`
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Jan 4 in Git & GitHub by akhtar
• 38,210 points

1 answer to this question.

0 votes


If the user has not generated an ssh public/private key pair set before then this kind of error occurs.  You need to create an SSH key pair and set the key in GitHub. It will solve your error.

answered Jan 4 by MD
• 95,300 points

Related Questions In Git & GitHub

0 votes
1 answer

How to solve the ‘Git commit -a error’?

This happens when no editor is set. ...READ MORE

answered Jul 5, 2018 in Git & GitHub by Tyrion anex
• 8,670 points
0 votes
1 answer

How do I solve a Git checkout error: updating paths is incompatible with switching branches?

This error occurs when you are checking ...READ MORE

answered Jul 26, 2018 in Git & GitHub by Sophie may
• 10,550 points
0 votes
1 answer

GitHub Error Message - Permission denied (publickey).

Hi@akhtar, I think GitHub isn't able to authenticate ...READ MORE

answered Jan 4 in Git & GitHub by MD
• 95,300 points
0 votes
1 answer
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
+2 votes
1 answer
0 votes
1 answer

How to untrack and remove a deleted file and log when we check git status ?

Hi@Shashi, You can use the git clean command. ...READ MORE

answered Oct 28, 2020 in Git & GitHub by MD
• 95,300 points
+1 vote
1 answer

How to view the change history of a file using Git versioning?

Hi@akhtar, You can use gitk for this task. ...READ MORE

answered Dec 22, 2020 in Git & GitHub by MD
• 95,300 points