git push 失败与解决方法汇总

1.http链接失败:

现象:

  1. “Permission denied (publickey).  
  2. fatal the remote hang up unexpectly

 原因:http链接失败

解决方法:

1)生成ssh密钥

2)然后将公钥拷贝到gitup配置之中。“Account Settings” > Click “SSH Public Keys” > Click “Add another public key” 

3)修改本地配置

  1. edit .git/config file under your repo directory
  2. find url=entry under section [remote "origin"]
  3. change it from url=https://[email protected]/derekerdmann/lunch_call.git tourl=ssh://[email protected]/derekerdmann/lunch_call.git. that is, change all the texts before @ symbol to ssh://git
  4. Save config file and quit. now you could use git push origin master to sync your repo on GitHub

参考:http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed/9575906#9575906

你可能感兴趣的:(git使用)