Git问题总结
发布日期:2021-10-23 14:13:22 浏览次数:6 分类:技术文章

本文共 794 字,大约阅读时间需要 2 分钟。

Git问题总结:

 

2016年07月01日 14:24:05 阅读数: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

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

转载于:https://www.cnblogs.com/sundaysgarden/p/10556159.html

转载地址:https://blog.csdn.net/weixin_30588827/article/details/98977163 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:jquery实现WIN7本地磁盘容量条效果
下一篇:Python爬虫入门教程 20-100 慕课网免费课程抓取

发表评论

最新留言

第一次来,支持一个
[***.219.124.196]2024年04月15日 09时48分11秒