Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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!

@imvivek71
Copy link

imvivek71 commented Dec 9, 2020

thanks, worked for me.

@rajputankit22
Copy link

rajputankit22 commented Dec 20, 2020

Sometimes, If two-factor authentication is enabled, then the command prompt clone through HTTPS won't work, So first of disabling two-factor authentication then direct clone otherwise .netrc file both will work perfectly.

@ranjan-del
Copy link

ranjan-del commented Dec 21, 2020

Pls tell steps by step

@mypride9990
Copy link

mypride9990 commented Dec 24, 2020

How can I do it on termux

@Immortalloops
Copy link

Immortalloops commented Jan 16, 2021

I can't login when performing git clone

Same problem

@mcly-hack
Copy link

mcly-hack commented Jan 23, 2021

Saya ingin menggunakan sebuah script namun diminta username dan password, bagaimana cara saya mengetahui username dan password script tersebut

@badal-44ear
Copy link

badal-44ear commented Feb 5, 2021

Hiii
I am facing a problem when I am getting cloned into Tortuga it asks me foe github username and password I have given many times the correct username and password but it is showing that nvelid username or pass word please help me to solve it

@badal-44ear
Copy link

badal-44ear commented Feb 5, 2021

Screenshot_20210205-202503

@abood334f43
Copy link

abood334f43 commented Feb 15, 2021

hgfgf

@mohammadgafoori1
Copy link

mohammadgafoori1 commented Feb 17, 2021

باسلام وقتتون بخیر من مشکل یوزنیم وپسورد دارم به کمک شما نیازدا رم
git clone https://github.com/thelinuxchoice/shellphish
Cloning into 'shellphish'...
Username for 'https://github.com':

@ranjan-del
Copy link

ranjan-del commented Feb 18, 2021

باسلام وقتتون بخیر من مشکل یوزنیم وپسورد دارم به کمک شما نیازدا رم
git clone https://github.com/thelinuxchoice/shellphish
Cloning into 'shellphish'...
Username for 'https://github.com':

First install apt install wget and then apt install git
Then and use link if it ask again then the link is not proper use any other clone link to install what u need

@you225
Copy link

you225 commented Feb 19, 2021

gist github.comhttps://www.facebook.com/naphat.chuekamhod

@mohammadgafoori1
Copy link

mohammadgafoori1 commented Feb 19, 2021

باسلام وقتتون بخیر من مشکل یوزنیم وپسورد دارم به کمک شما نیازدا رم
git clone https://github.com/thelinuxchoice/shellphish
Cloning into 'shellphish'...
Username for 'https://github.com':

First install apt install wget and then apt install git
Then and use link if it ask again then the link is not proper use any other clone link to install what u need

باسلام من متوجه نشدم امکانش هست باعکس توصیح بدین با تشکر

@mohammadgafoori1
Copy link

mohammadgafoori1 commented Feb 20, 2021

2021-02-20_04-26-57

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

@MichaelWiebeInquirer
Copy link

MichaelWiebeInquirer commented Feb 22, 2021

Sometimes, If two-factor authentication is enabled, then the command prompt clone through HTTPS won't work, So first of disabling two-factor authentication then direct clone otherwise .netrc file both will work perfectly.

disabling 2-factor auth worked for me

@a092devs
Copy link

a092devs commented Mar 10, 2021

thanks, worked on termux

@astupka
Copy link

astupka commented Mar 24, 2021

@surajvirus3
Copy link

surajvirus3 commented Mar 30, 2021

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

OliveNationhub commented May 22, 2021

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

@Princewill4
Copy link

Princewill4 commented Jul 3, 2021

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

ketankvishwakarma commented Jul 18, 2021

Yap It works in Ubantu 20

@Ola-rewaju
Copy link

Ola-rewaju commented Aug 11, 2021

None of this things is working

@osandajanuka
Copy link

osandajanuka commented Oct 12, 2021

how to put commands to this folder?

@andreborgescastro
Copy link

andreborgescastro commented Oct 29, 2021

Worked fine to me. Thanks man.

@scottjmaddox
Copy link

scottjmaddox commented Nov 17, 2021

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

Samsontyler7 commented Mar 17, 2022

How to remove 2 set password

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