Git push error under CENTOS 6.7

$ git add file
$ git commit -m "xxxx"
$ git push

error: The requested URL returned error: 403 Forbidden while accessing https://github.com

fatal: HTTP request failed

Change your ~/.gitconfig as follows:

$ cat ~/.gitconfig 
[user]
	name = xxx
	email = xxx@gmail.com
[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url= https://name@github.com/name/xxx.git
Answered by harryxiyou.

Weiwei Jia

Weiwei Jia is a Ph.D. student in the Department of Computer Science at New Jersey Institute of Technology since 2016. His research interests are include storage systems, operating systems and computer systems.

Leave a Reply

Your email address will not be published. Required fields are marked *