Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git (1.7.10) asks me every time for username and password

Since I have the new version it doesnt ask me anymore for the password I set in my ssh key file.

It asks now directly for a github username and password when I push every time.

Is this a new feature of git or changed it in the past or is there something which changed on github?

I tried to authenticate using ssh and the email and password from my ssh key file and it worked.

GitHub changed to smartftp and also changed the instructions for setting up repos

https://github.com/blog/1104-credential-caching-for-wrist-friendly-git-usage

https://help.github.com/articles/create-a-repo

Saw it later, they use now https instead of the git protocol by default

like image 857
Daniel Ruf Avatar asked Jun 09 '12 15:06

Daniel Ruf


2 Answers

I ran into this the other day when cutting-and-pasting from the new repository instructions on GitHub. Someone should probably file a bug report, because it confuses almost everyone I know.

The issue is that the instructions tell you to create a remote that uses the https protocol, rather than the git protocol. I typically use:

github_username=CodeGnome
git remote add origin "[email protected]:${github_username}/${PWD##*/}.git"
git push --tags --set-upstream origin master

to populate a new GitHub repository from a pre-existing local one.

like image 137
Todd A. Jacobs Avatar answered Oct 23 '22 20:10

Todd A. Jacobs


git config --global credential.helper cache
git config --global credential.helper 'cache --timeout=3600'

you only input your username and password when you push first;after 3600s or 1 hour ,you push without username and password .

timeout you could set your number.

like image 33
yuer juedai Avatar answered Oct 23 '22 18:10

yuer juedai