👋 We've unified all of GitHub's product documentation in one place! Check out the content for REST API, GraphQL API, and Developers. Learn more on the GitHub blog.
Article version: Enterprise Server 2.20

Why is Git always asking for my password?

If Git prompts you for a username and password every time you try to interact with GitHub, you're probably using the HTTPS clone URL for your repository.

Were you able to find what you were looking for?

Using an HTTPS remote URL has some advantages compared with using SSH. It's easier to set up than SSH, and usually works through strict firewalls and proxies. However, it also prompts you to enter your GitHub credentials every time you pull or push a repository.

You can avoid being prompted for your password by configuring Git to cache your credentials for you. For enhanced security, we recommend using a personal access token (PAT) instead of a password. Treat your PAT just like a password and enter your PAT when prompted for a password. For more information, see "Creating a personal access token."

Once you've configured credential caching, Git automatically uses your cached personal access token in place of a password when you pull or push a repository using HTTPS.

Further reading

Were you able to find what you were looking for?

Ask a human

Can't find what you're looking for?

Contact us