May 31, 2022

Git asks for password each time I git push”. Solution: caching credentials with git

If you cloned a repository using HTTPS, git will ask for credentials each time you git push”.

You can cache credentials so that you don’t have to enter credentials each time you git push”.

To cache your credentials:

$ git config credential.helper store
$ git push <HTTPS URL of repository>

Git should ask for your username and password:

Username: <USERNAME>
Password: <PASSWORD>

Next time you run git push”, git should not ask for credentials.

By the way, if you are not sure whether you added the remote as HTTPS or SSH, you can check by running:

$ git remote -v

remote” shows you which remote servers you have configured; -v” shows you the URLs that Git has stored.

Please note that your credentials are stored in plain text locally.

git command-line interface (cli) personal computing gnu linux

No affiliate links, no analytics, no tracking, no cookies. © 2016-2023 Content is licensed under CC BY-NC-SA 4.0 .