使用细粒度个人访问令牌(PAT)克隆GitHub存储库。

14
使用经典的 Github 令牌,您可以像这样克隆存储库:
git clone https://<your-token>@github.com/owner/repo.git

这不能与新的细粒度令牌一起使用。

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


请注意,f-g PATs目前不适用于外部合作者。 - Robino
1个回答

26

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

git clone https://oauth2:<your-fine-grained-token>@github.com/owner/repo.git

*感谢Andy在这里的评论


1
不错的提示!顺便说一下,使用我的用户名而不是 oauth2 也可以。 - Chih-Hsuan Yen
1
谢谢!这对我有用: git clone https://<your-fine-grained-token>@github.com/<ownerusername>/repo.git - undefined
谢谢!这对我有用: git clone https://<your-fine-grained-token>@github.com/<ownerusername>/repo.git - uh84

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接