解决 `remote: You must use a personal access token with 'api' scope for Git over H

2023-06-17 21:40:19 浏览数 (1)

背景

在家远程办公的时候 git clone 报错:

代码语言:txt复制
remote: HTTP Basic: Access denied
remote: You must use a personal access token with 'api' scope for Git over HTTP.
Access deniedAccess denied

解决方案

通过其提示的地址生成一个 Token:

代码语言:txt复制
remote: You can generate one at https://example.com/profile/personal_access_tokens
generategenerate

然后通过命令行组合 Token 操作即可:

代码语言:txt复制
git clone https://oauth2:${PERSONAL_ACCESS_TOKEN}@example.com/example/example.git
git clonegit clone

0 人点赞