Save Username and Password in Git Credentials Storage

Git – Config Username & Password – Store Credentials

If you get tired of entering your password when pushing to your Git Remote Repository, this ShellHacks 2019 post is all you need to know on saving Username and Password in Git Credentials Storage.

For a single repo:

Run the following command to enable credentials storage in your Git repository:

$ git config credential.helper store

To enable credentials storage globally, run:

$ git config --global credential.helper store

When credentials storage is enabled, the first time you pull or push from the remote Git repository, you will be asked for a username and password, and they will be saved in ~/.git-credentials file.

If you have multiple repositories the post describes using the useHttpPath option as well.