码迷,mamicode.com
首页 > 其他好文 > 详细

Git问题总结

时间:2019-03-19 01:41:00      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:pop   post   iss   error:   blank   request   entity   url   targe   

https://blog.csdn.net/hejiamian/article/details/51800763

Git问题总结:

 

2016年07月01日 14:24:05 ascetictor 阅读数:1303

 

Git问题总结:

1.$ git push origin :dev-xx

remote: Permission to xxx/xxx.git denied to xxx.

fatal: unable to access ‘https://github.com/xxx/xxx.git/‘: The requested URL returned error: 403

问题原因主要是电脑上有两个github账号时,每个账号对应不同的ssh,比如:

 

he:.ssh he$ ls

config id_rsa.pubid_rsa_he.pub

id_rsa id_rsa_heknown_hosts

he:.ssh he$ cat config

#Default GitHub

Host github.com

  HostName github.com

  User git

  IdentityFile ~/.ssh/id_rsa

 

Host github-he

  HostName github.com

  User git

  IdentityFile ~/.ssh/id_rsa_he

这时需要切换成对应的ssh

$ git remote rm origin
$ git remote add origin git@github-he:xxx/xxx.git

然后再执行上次的命令,就会成功了,如下:
$ git push origin :dev-xxx
To git@github-he:xxx/xxx.git
 - [deleted]         dev-xxx

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 





Git问题总结

标签:pop   post   iss   error:   blank   request   entity   url   targe   

原文地址:https://www.cnblogs.com/sundaysgarden/p/10556159.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!