Mac下通过gh命令下载Github私有项目
1、安装gh命令
brew install gh
查看gh版本
gh --version
gh version 2.95.0 (2026-06-17)
https://github.com/cli/cli/releases/tag/v2.95.0
2、登陆gh
gh auth login
3、Where do you use GitHub?
选择GitHub.com
> GitHub.com
4、What is your preferred protocol for Git operations on this host?
选择HTTPS
> HTTPS
5、Authenticate Git with Github credentials?
选择Y
6、How would you like to authenticate GitHub CLI?
Paste an authentication token
> Paste an authentication token
7、把Github上的Token拷贝进来
? Paste your authentication token: ****************************************
8、展示下面信息则表示登陆成功
- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as zhangfanxp
9、下面直接拉取项目即可
评论
发表评论