Skip to main content

Why is Git always asking for my credentials?

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

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.

Lorsque Git vous invite Ă  entrer votre mot de passe, entrez votre personal access token. Vous pouvez Ă©galement utiliser une assistance d’informations d’identification comme Git Credential Manager. L’authentification par mot de passe pour Git a Ă©tĂ© supprimĂ©e en faveur de mĂ©thodes d’authentification plus sĂ©curisĂ©es. Pour plus d’informations, consultez « Gestion de vos jetons d'accĂšs personnels Â».

You can avoid being prompted for your password by configuring Git to cache your credentials for you. Once you've configured credential caching, Git automatically uses your cached personal access token when you pull or push a repository using HTTPS.

Further reading