2

I set up a ssh key on the machine, cloned a branch on my local machine then tried to delete its associated branch on the remote. Below are my step.

  1. Delete the local branch using git branch -D abc-123
  2. Set the url to be ssh one. (git remote set-url origin git@git_server:group_name/product_name.git) Source
  3. Delete the remote branch using git push origin --delete abc-123 Source

The problem is on step 3. it prompts for password and after I typed the correct one it say permission denied.

I wonder what I did wrong and how to fix it.

Community
  • 1
  • 1
Anonymous
  • 9,366
  • 22
  • 83
  • 133
  • Have you inform the remote server of your ssh public key ? The good thing with ssh protocol is that you don't need to have a password (and it's fast). So unless the password is in fact your ssh pass phrase, there is something wrong. – chaiyachaiya Apr 28 '14 at 13:44
  • @chaiyachaiya Yes, generated an ssh key and added it to My SSH Kay Page. – Anonymous Apr 29 '14 at 03:21
  • ok but when you say the "correct password", in what sense is it correct ? I mean normally, you do not have to give a password at all with ssh. What happen if you do any remote opertation like "git remote show [remote_name]" ? – chaiyachaiya Apr 29 '14 at 09:06

1 Answers1

0

To check what git uses under the hood run,

$ GIT_TRACE=1 git push origin --delete abc-123
...
trace: run_command: 'ssh' 'git@github.com' 'git-receive-pack '\''group_name/product_name.git'\'''
...

Note the ssh commands that git runs.

Then follow GitHub’s troubleshooting Error: Permission denied (publickey) and explicitly troubleshoot the ssh connection part for ssh –vvT git@github.com.

mockinterface
  • 14,452
  • 5
  • 28
  • 49