Home > Enterprise >  Git always ask for username and password in ubuntu
Git always ask for username and password in ubuntu

Time:03-18

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.

CodePudding user response:

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.

CodePudding user response:

try to use $ git config --global user.name "your name"and$ git config --global user.email "your email"

  • Related