Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git push returning error and not prompting for password

Tags:

git

github

I followed the first steps after creating a repository in github, but when I got to the line: git push -u origin master it fails with this error:

user$ git push -u origin master
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/thestranger/cfinder.git/info/refs

fatal: HTTP request failed

I have remote added the correct origin url and I have git 1.7.10. The weird thing is that it is not prompting me for a username or password at all so I don't know what it's trying to use to access the repository on github. Does anyone know why it wouldn't prompt me for a password?

To clarify, the steps I followed were the ones github showed me after immediately creating the repository:

touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/thestranger/cfinder.git
git push -u origin master
like image 893
Swiss Avatar asked Aug 24 '12 01:08

Swiss


People also ask

Why does git not ask for password?

The most likely reason for this is that Git has been configured to use a credential helper. The configuration could have been made a) for all users in your system b) only for your user c) for a specific repository.

Why git push is not working?

It may be possible that push permission is not provided to the user pushing the code changes. I suggest checking the user permissions. If the push permission is present, then it may be possible that there is a pre-push git hook in the repo and your push isn't in accordance with it.

Can't push to GitHub authentication failed?

It happens if you change your login or password of git service account (Git). You need to change it in Windows Credentials Manager too. type "Credential Manager" in Windows Search menu open it. Windows Credentials Manager->Windows Credential and under Generic Credentials edit your git password.


1 Answers

You might try changing the URL to use SSH instead of HTTPS. In the root of your repo:

git remote set-url origin [email protected]:thestranger/cfinder.git

This will require that you have a public key registered on your GitHub account.

like image 98
Brandan Avatar answered Oct 20 '22 03:10

Brandan