1

At work and on my own computer I normally use github with ssh keys. I also installed 2-factor authentification via text-message. Everything works fine.

But when I'm at another computer, where I do not have my ssh key, I'm of course not able to checkout from my (private) repository via the

git clone git@github.com:joergi/myproject.git

But when I switch to the HTTPS Version I can not checkout via

git clone https://github.com/joergi/myproject.git
Cloning into 'myproject'...
Username for 'https://github.com': joergi
Password for 'https://joergi@github.com': 
remote: Invalid username or password.
fatal: Authentication failed for 'https://github.com/joergi/myproject.git/'

Username and password are 100% correct.

Is there any way to use HTTPS , when 2-factor authentication is activated?

Aman Neo
  • 223
  • 2
  • 7
Joergi
  • 1,527
  • 3
  • 39
  • 82
  • 1
    I ran into this problem as well. I ended up just using it as ssh. This is a duplicate http://stackoverflow.com/questions/2505096/cloning-a-private-github-repo – yxre May 13 '17 at 11:09
  • but I don't want to have a ssh key to my repo on someones else computer. no other way? – Joergi May 13 '17 at 11:15
  • @LelandBarton - and it's not really a duplicate. this guy was using the wrong (read only) url - I'm asking if it's generally possible to checkout via HTTPS. – Joergi May 13 '17 at 11:17
  • I figured there was a little bit more to this question. – yxre May 13 '17 at 11:21

1 Answers1

3

Here is documentation from github on how two factor auth behaves. It discusses https repositories on the command line. You can generate a personal access token and use that to login.

The price of security is a inconvenience. You could temporarily disable two factor auth as well.

yxre
  • 3,576
  • 21
  • 20
  • I still use MY GITHUB account. this person doesn't have a github account at all. I want to check out MY private repo without adding another ssh key. like using the 2-way-authentification for checking out or something like that – Joergi May 13 '17 at 11:25