Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git doesn't ask for user name

Tags:

git

github

I worked alone on a project versioned on Github, so for convenience I put something like this in my ~/.git/config file:

url = https://[email protected]/COMPANY/PROJECT.git

This way git asks only for password on pull/push. But now more people have to push and pull, so we thought this would make git ask also for user name:

url = https://github.com/COMPANY/PROJECT.git

But instead git asks for nothing now and this is a sample result of git pull:

error: The requested URL returned error: 403 while accessing https://github.com/COMPANY/PROJECT.git/info/refs

fatal: HTTP request failed

How can git be forced to ask for user name and password as expected?

like image 889
Rafał G. Avatar asked Oct 29 '13 09:10

Rafał G.


People also ask

How do I make Git not ask for username and password?

You can avoid being prompted for your password by configuring Git to cache your credentials for you. Once you've configured credential caching, Git automatically uses your cached personal access token when you pull or push a repository using HTTPS.

Should your Git username be your name?

No, your user.name does not matter. However your user. email should match one of the addresses in your GitHub settings.


1 Answers

I work on some different servers now and I've noticed that this issue affects git 1.7.0.4, but not the newer 1.7.9.5. So anyone experiencing the same problem should upgrade their git if possible.

@jszakmeister suggested asking the git mailing list, but having read this stackoverflow thread and this github page I think there's no point, it looks like a known problem without a good known solution. Github say they recommend git 1.7.10 and people in the stackoverflow discussion suggest things that don't really solve my problem. So I guess the only option is updating your git - let consider that the solution and this question answered.

like image 167
Rafał G. Avatar answered Oct 17 '22 19:10

Rafał G.