I am trying to clone a repository from my GitHub account. I have logged into my account using:
> gh auth login --with-token < gh-token.txt
> gh --version
gh version 2.4.0+dfsg1 (2022-03-23 Ubuntu 2.4.0+dfsg1-2)
https://github.com/cli/cli/releases/latest
> gh auth status
github.com
✓ Logged in to github.com as mogur (/home/jonathon/.config/gh/hosts.yml)
✓ Git operations for github.com configured to use https protocol.
✓ Token: *******************
Everything seems fine until I try and clone a repository.
> gh repo clone mogur/alpha
Cloning into 'alpha'...
Username for 'https://github.com': mogur
Password for 'https://mogur@github.com': **************
gh auth git-credential: "erase" operation not supported
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-
remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/mogur/alpha.git/'
exit status 128
I can't seem to find any documentation that would explain these results. I'm confused as to why I am being asked for a username and password.
I followed the instructions from "https://cli.github.com/manual/gh_repo_clone" and was expecting:
Cloning a repository:
~/Projects$ gh repo clone cli/cli
Cloning into 'cli'...
~/Projects$ cd cli
~/Projects/cli$
I also tried:
~/Projects/my-project$ gh repo clone https://github.com/cli/cli
Cloning into 'cli'...
remote: Enumerating objects: 99, done.
remote: Counting objects: 100% (99/99), done.
remote: Compressing objects: 100% (76/76), done.
remote: Total 21160 (delta 49), reused 35 (delta 18), pack-reused 21061
Receiving objects: 100% (21160/21160), 57.93 MiB | 10.82 MiB/s, done.
Resolving deltas: 100% (16051/16051), done.