Reputation: 11
I am currently using git via command line. I need git to ask for username and password every time I push or pull my repository. Currently it just asks for password. Please help me here. The url in .git/config
file is somewhat like this:
https://[email protected]/hello/folder.git
Upvotes: 0
Views: 3720
Reputation: 7
I was facing the same issue and solved it using these two commands:
git config --global credential.https://github.com.username username
git config --global credential.https://github.com.email [email protected]
Try to use these two commands
username => actual user name of your profile
[email protected] => actual github account email
Upvotes: 0
Reputation: 97
Setting the credential helper works for me.
Simply type the following and hit enter:
git config --global credential.helper store
Upvotes: 1
Reputation: 78623
You've indicated that the URL that you're using is:
You've put your username in the URL. The xxxxx
portion of the URL is the username that you want to use for authentication. Since you've already provided it, Git will not prompt you for it. It will, however, prompt you for the password (though you could have included that in the URL as well, with the form https://xxxxx:[email protected]/hello/folder.git
).
If you want to be prompted for both username and password, simply remove it from the URL:
Upvotes: 0
Reputation: 41
git push https://github.com/user_name/repo_name.git
then give your id and password
user_name and repo_name you have to put.
Upvotes: 0
Reputation: 24136
Unset credential before Pull/Push.
$ git config --unset credential.helper
$ git pull
Upvotes: 1
Reputation: 9427
Using git through ssh instead of https is one way to have passwordless authentication.
Here is a github manual page on the topic.
The steps (roughly) involve;
ssh-keygen -t rsa
, leave the password blank)~/.ssh/id_rsa.pub
as per these instructionsI admit it takes a little bit of fiddling to get set up - but once done, you shouldn't have to do it again on that PC. That is, you can then clone any other repo on github (using the ssh clone) without needing to type any password.
Upvotes: 0