After creating a repository at GitHub, I follow the instruction given by GitHub:
$ echo "# test" >> README.md
$ git init
$ git add README.md
$ git commit -m "first commit"
$ git remote add origin https://github.com/user/test.git
$ git push -u origin master
(In the above URL the actual user name is replaced with user
.)
Then I am asked (by Ksshaskpass) about
Password for 'https://[email protected]':
(The user name is not asked.) This xxxxxxxx
is actually the initial password which I used when I created an account at GitHub. And my password is denied, so that I can not push the data.
I am expecting the output like the following.
$ git push -u origin master
Username: <username>
Password: <password>
I removed ~/.gitconfig
, but the situation does not change. (The username is not asked yet.) There does not exist the directory ~/.git
. So I suspect that there is a wrong configuration file which I created a long time ago, but I can not find it.
Could you give me any hint about this phenomenon?
Env: openSUSE 13.2, git-2.1.4-13.1.x86_64
Change the remote url to ssh
.
https will keeep asking you for password every time you wish to run git pull/push/fetch
.
Simply follow those steps and you will set up your ssh key in no time:
Generate a new ssh key (or skip this step if you already have a key)ssh-keygen -t rsa -C "your@email"
Once you have your key set in home/.ssh
directory (or Users/<your user>.ssh
under windows), open it and copy the content
Login to github account
Click on the rancher on the top right (Settings)
Click on the SSH keys
Click on the Add ssh key
Paste your key and save
Change the remote url git remote set-url origin <new_ssh_url>
And you all set to go :-)
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