Android Studio: Wrong Username in Git Pull/Fetch Dialog

I am using git in the Android Studio when I am trying to pull, fetch then it is asking password for --global.

1

3 Answers

You probably ran this:

git config credential.username --global username

Instead of

git config --global credential.username username

To fix it, do:

git config credential.username username

And to do what you originally intended to do:

git config --global credential.username username

You should try entering username and password for your GitHub account or try login with Github.

2

If your remote is https you might enter username and password every time! you can check remote with this command:

git remote -v

If you see something like this: origin https:// , then it's HTTPS remote.

You can connect your remote with ssh which is better than https, and you don't need to enter your username/password every time.

but with ssh you will see remote like this:

origin  :myusername/project.git

based on your operating system it's different to do it, search how to generate ssh key and add it into the GitHub on Linux/Windows/Mac.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Elena Rostova

Elena Rostova

Lead Health, Wellness & Medical Journalist

Elena Rostova holds a Master's degree in Public Health Journalism. She covers groundbreaking medical research, holistic wellness trends, mental health awareness, and nutritional science.

Share this article
Twitter Facebook Pinterest