【问题标题】:Use fine-grained personal access token instead of classic one使用细粒度的个人访问令牌而不是经典的
【发布时间】:2022-12-21 19:26:26
【问题描述】:

来自github documentation

GitHub 建议您尽可能使用细粒度的个人访问令牌而不是个人访问令牌(经典)

我需要一个简单的令牌来访问存储库(因此通过 https 的 git clone 将起作用)。我让它与经典令牌一起使用,但即使获得所有可能的许可,细粒度令牌也会返回 remote: Write access to repository not granted.

不应该是代码访问基本功能吗?是否有细粒度的令牌替换来读取和写入存储库?

【问题讨论】:

  • 投票重新开放,因为这个问题是关于git clone,而链接的副本是关于git pull。我不能为 git clone 使用细粒度的令牌 - 除了在另一个问题 GitHub clone repo with fine-grained personal access tokens (PAT) 中显示的方式 - 这种方式的缺点是它需要你将令牌放在 URL 中(坏主意)。我无法调整此问题的 dupe-target 中的方法以保护令牌的方式与 git clone 一起使用。

标签: git github token


【解决方案1】:

我可以通过细粒度 PTA 获取访问令牌。 有办法得到它。

您需要给 PTA 一个正确的写权限。 详细信息在这里。 Using a GitHub fine-grained token with git pull over HTTPS

【讨论】:

    猜你喜欢
    • 2022-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-19
    • 2020-12-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多