Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github repository not cloning using gh cli

I want to clone my public repository from Github to my local system using gh official cli.

I copied the following command from the repo (green code button) button and also followed the official documentation -

sudo gh repo clone <username>/<repo-name>

But the repository does not clone, but instead, the command returns the following output on the terminal.

Welcome to GitHub CLI!

To authenticate, please run `gh auth login`.

I also executed gh auth login and logged in. But still, the command returns the same output.

I can clone the same repository using following command

git clone "url"

I am using Ubuntu 18.04. How can I clone the repository using gh.

like image 583
Devashish Prasad Avatar asked Mar 29 '26 02:03

Devashish Prasad


1 Answers

Try the command without sudo : gh repo clone (username)/(repo-name). If login is successfully done, this should work. For reference you can check[1].

[1]make git clone with sudo

like image 130
Kavita Gupta Avatar answered Apr 01 '26 09:04

Kavita Gupta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!