使用细粒度令牌克隆 GitHub 存储库

Flo*_*ris 15 github github-fine-grained-tokens

使用经典的Github 代币,您可以像这样克隆一个存储库:

git clone https://<your-token>@github.com/owner/repo.git
Run Code Online (Sandbox Code Playgroud)

这不适用于新的细粒度令牌。

如何使用新的细粒度令牌克隆 GitHub 存储库?

Flo*_*ris 28

使用细粒度令牌时,必须在令牌前加上oauth2:user 前缀。
像这样:

git clone https://oauth2:<your-fine-grained-token>@github.com/owner/repo.git
Run Code Online (Sandbox Code Playgroud)

*此处归功于安迪的评论