赞
踩
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/
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。