Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created June 6, 2012 21:42
Show Gist options
  • Save ahoward/2885020 to your computer and use it in GitHub Desktop.
Save ahoward/2885020 to your computer and use it in GitHub Desktop.
Fix Username/Password prompting for github repos cloned via https scheme

github recently switched to an https scheme as the default for cloning repos. as a side effect you may suddenly be prompted for a 'Username' and 'Password' when you push where, previously, you were able to do so without typing in credentials. the solution is to cause git to cache https credentials which is easy, since git uses curl under the covers

in your home directory create a file called '.netrc', for example

/Users/ahoward/.netrc

in it put these contents

machine github.com
login YOUR_GITHUB_USERNAME
password YOUR_GITHUB_PASSWORD

fixed!

@LuizFTS
Copy link

LuizFTS commented Jun 26, 2023

2021-02-20_04-26-57
من مشکل یورنیم وپسورد دارم کمکم کنید

im getting same , whats the solution ? could you please>

I tried to clone with my username and my password and it didn't work. So I checked the docs and it says that instead of our password, we have to type our access token.

This link should help to generate your personal access token and then clone the git repository:
https://docs.github.com/en/[email protected]/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens

@mimisad916
Copy link

2021-02-20_04-26-57

من مشکل یورنیم وپسورد دارم کمکم کنید

you can just write git clone then you type this link https://github.com/suljot/shellphish.git

@AliHCl
Copy link

AliHCl commented Sep 25, 2023

2021-02-20_04-26-57

من مشکل یورنیم وپسورد دارم کمکم کنید

First, type the command 'gh auth login' in the command line, then use the arrow keys on your keyboard to select the option 'GitHub.com' and press Enter. After that, choose the 'http' , and then log in to your account through browser.

@miraclemarko
Copy link

### THIS IS FOR FIX SOLUTION YOUR PROBLEM.

Run

git config --global credential.helper store

DONE. THANKYOU

@Queetinliu
Copy link

i use gitlab,yes use this solution i can git clone without username password promption.

@pooriar1991
Copy link

2021-02-20_04-26-57

من مشکل یورنیم وپسورد دارم کمکم کنید
یوزر پسورد گیت هاب‌ت رو بزن اکی میشه

@MrSavage6995
Copy link

Probably dumb question but where it says your_username I use mine lmao 🤣

@mohgoro
Copy link

mohgoro commented May 7, 2024

Cela a bien fonctionné pour moi. Merci mec.

@Ikyanakbaik
Copy link

Screenshot_20240525-104548
Ini gimana

@EJEASIntercom
Copy link

This code is very useful for me, thanks for sharing! EJEAS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment