Git add username and password locally

If for some reason Github credentials have to be stored on a local system this set of commands will help to set it up.

Create the file:

vim ~/.git-credentials

Content:

https://username:password@github.com

chmod & chown properly:

USER=$(whoami); chown ${USER}:${USER} ~/.git-credentials

chmod 600 ~/.git-credentials

Run this command to make git aware of it:

git config --global credential.helper store


Published

Category

Cheatsheet

Tags

Contact