Storing command line Git credentials

A short note on avoiding typing your password at every push

Andrea Telatin

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 "your@github.email.com"...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

Andrea Telatin

Written by

Bioinformatics and Genomics, Norwich UK

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade