Storing command line Git credentials
A short note on avoiding typing your password at every push
The unsafe way of caching git credentials is:
git config --global user.name "your username"
git config --global user.password "your password"
git config --global credential.helper store
This is a general procedure that can be used for any Git server, but considering it’s storing your password in plain text this could be a safety issue, even if your home is not accessible by other users.
GitHub easily allow to use an ssh-key.
First you can generate your keyfile by:
ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org"...follow instruction and note where your file is saved for the following commmand...ssh-add ~/.ssh/id_rsa
In your GitHub account, under the Settings page:
You’ll find the “SSH and GPG keys” section, where you can add the content of the ~/.ssh/id_rsa.pub (.pub to be added, as it contains the public key).
This article is a stub