'Git always ask for username and password in ubuntu

I recently shifted from windows to ubuntu.

I'm working on company's repo as collaborator and I do have all permissions. Git was working fine on my windows machine but in ubuntu it ask for username & password each time when ever i use git pull.

I tried to search different solution on google but nothing works for me.



Solution 1:[1]

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.

If you're cloning GitHub repositories using HTTPS, I recommend you use GitHub CLI or Git Credential Manager (GCM) to remember your credentials.

GitHub CLI

GitHub CLI will automatically store your Git credentials for you when you choose HTTPS as your preferred protocol for Git operations and answer "yes" to the prompt asking if you would like to authenticate to Git with your GitHub credentials.

  1. Install Github CLI
  2. In the command line, enter gh auth login, then follow the prompts. When prompted for your preferred protocol for Git operations, select HTTPS. When asked if you would like to authenticate to Git with your GitHub credentials, enter Y.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Rakesh B E