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!

@OliveNationhub
Copy link

My is not working,
Still asking for password and username.

@Princewill4
Copy link

Just install hacker keyboard and try

On Mon 24 Feb, 2020, 6:09 PM Yasser645, @.***> wrote: Hey I couldn't access to it, tall why — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://gist.github.com/2885020?email_source=notifications&email_token=ANXKLGQVCSU3736JMYQENHTREO5XRA5CNFSM4HQKNUDKYY3PNVWWK3TUL52HS4DFVNDWS43UINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAGCRJQ#gistcomment-3187352, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANXKLGS7J25J7EJB7RH2ENLREO5XRANCNFSM4HQKNUDA .

But this time around use your email as your username

@ketankvishwakarma
Copy link

Yap It works in Ubantu 20

@Ola-rewaju
Copy link

None of this things is working

@osandajanuka
Copy link

how to put commands to this folder?

@andreborgescastro
Copy link

Worked fine to me. Thanks man.

@scottjmaddox
Copy link

Works great in Termux on Android!

@hysh1
Copy link

hysh1 commented Dec 7, 2021

work

Can you hack an account for me

@tesddev
Copy link

tesddev commented Dec 7, 2021

like magic, it works!

@tesddev
Copy link

tesddev commented Dec 7, 2021

Works on Mac OS

@Samsontyler7
Copy link

How to remove 2 set password

@ad006875
Copy link

Screenshot_2022-05-31-09-03-46-76_84d3000e3f4017145260f7618db1d683

@Bhatayan
Copy link

IMG_20220614_172425
What I do plz help

@algokra
Copy link

algokra commented Oct 7, 2022

Authentication failed for 'https://github.com/Zucccs/PhoneSploit/'

@aminesad
Copy link

It asks me to put my username and password, what do I do?

@vk3xem
Copy link

vk3xem commented Jan 17, 2023

How was I subscribed to this thread? I just received an email about the thread that I have never seen before!

@Alimozaffari9
Copy link

سلام کسی هست ازمن هم یوزرنم با پسورد میخاد

@vidya-syt
Copy link

2021-02-20_04-26-57

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

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

@Kamilhassan786
Copy link

خاو شن کرار

@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