I want to push README.md to Github.
Using Ubuntu 14.04LTS
So, I commit in the following steps.
echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/user/repo.git
git push -u origin master
But, below error occurred.
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/user/repo.git/info/refs
fatal: HTTP request failed
I know solve this error this way
git remote set-url origin https://[email protected]/user/repo.git
In this way , I must enter password.
$ git push origin master
Password:
But I hate to enter password.
I have checked this, but I don't solved.
Pushing to Git returning Error Code 403 fatal: HTTP request failed
Please tell me how to push without password.
The first is relatively simple to resolve and simply involves checking to ensure your GitHub password is correct. If the error persists, it is likely that you have to use a different HTTPS address in your Git client. For this error, you will not even be prompted to enter a password, making it simpler to diagnose.
For the second situation, you need to initialize the Git repository in your project folder. To do so, you need to navigate to the correct folder and then run the command git init , which will create a new empty Git repository or reinitialize an existing one.
This may solve your problem:
git remote set-url origin https://username:[email protected]/user/repo.git
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With