Skip to content

Instantly share code, notes, and snippets.

@ahoward
Created June 6, 2012 21:42
Show Gist options
  • Star 59 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • 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!

@astupka
Copy link

astupka commented Mar 24, 2021

@surajvirus3
Copy link

Screenshot_20210330_065548
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/thelinuxchoice/sayhello/'

@srcrypton
Copy link

srcrypton commented May 1, 2021

i have the same problem i don't' get sameone can help me with this

golang-1.15-src
Use 'sudo apt autoremove' to remove it.
0 upgraded, 0 newly installed, 0 to remove and 468 not upgraded.
fatal: destination path 'Gemail-Hack' already exists and is not an empty directory.
Directory facebook exists.[✔]
fatal: destination path 'instainsane' already exists and is not an empty directory.
chmod: cannot access 'instainsane.sh': No such file or directory
chmod: cannot access 'install.sh': No such file or directory
sudo: ./install.sh: command not found
Cloning into 'tweetshell'...
Username for 'https://github.com':

remote: Repository not found.
fatal: repository 'https://github.com/thelinuxchoice/instainsane.git/' not found
./install-sb.sh: line 19: cd: instainsane: No such file or directory
chmod: cannot access 'instainsane.sh': No such file or directory
chmod: cannot access 'install.sh': No such file or directory
sudo: ./install.sh: command not found
Cloning into 'tweetshell'...
Username for 'https://github.com':

@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/enterprise-server@3.4/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

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

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