当前位置:   article > 正文

github 提交报403 错误解决方法_github 团队项目 http 403

github 团队项目 http 403

Linux环境问题出现如下:

git提交工程代码:

git push origin master

出现错误:

error: The requested URL returned error: 403 Forbidden while accessing https://github.com/username/pro.git/info/refs

fatal: HTTP request failed

两种解决问题方法:

1、修改.git/config文件中以下内容:

From: url = https://github.com/username/pro.git

To: url = https://username@github.com/username/pro.git 

or  url = https://username:password@github.com/username/pro.git 

2、直接执行命令:

git remote set-url origin https://username@github.com/username/pro.git


Linux环境下配置SSH:

1、ssh-keygen -t rsa -C "your_email@example.com"

2、ssh-agent -s

3、ssh-add ~/.ssh/id_rsa

4、修改www.github.com中SSH keys

5、添加~/.ssh/XX.pub内容到“Key”中,保存

6、ssh -T git@github.com 测试成功如下:

Hi username! You've successfully authenticated, but GitHub does not
# provide shell access.

配置引自:https://help.github.com/articles/generating-ssh-keys/

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/567586
推荐阅读
相关标签
  

闽ICP备14008679号