I work on private git repos from github and everytime I pull or push I need to type my github username and password. Is there a way to make it not to ask for password every time?
I using Xubuntu GNU/Linux with command line.
I'd use SSH connection rather than HTTPS.
Just create a key, give it to Github you should be good to go: https://help.github.com/articles/generating-ssh-keys
If you are already using HTTPS, you can easily change the remote's url to SSH:
git remote set-url origin [email protected]:user/repo.git
Now you will be able to push/pull
over SSH. More information can be found on Github
If you are cloning a new repo, make sure to use SSH clone url provided by Github on the repo's page.
From the github website: https://help.github.com/articles/set-up-git#platform-linux
Password caching
The last option you set will tell Git that you don't want to type your username and password every time your computer talks to GitHub.
Tips:
You need Git 1.7.10 or newer to use the credential helper. The credential helper only works when you clone a GitHub repository using an HTTPS URL. If you clone GitHub repositories using SSH, then you authenticate using SSH keys instead of a username and password. For help setting up an SSH connection, see Generating SSH Keys. To use this option, you need to turn on the credential helper so that Git will save your password in memory for some time:
git config --global credential.helper cache
# Set git to use the credential memory cache
By default Git will cache your password for 15 minutes. You can change this if you like.
git config --global credential.helper 'cache --timeout=3600'
# Set the cache to timeout after 1 hour (setting is in seconds)
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