【发布时间】:2021-09-23 19:23:17
【问题描述】:
[环境:RStudio 版本 1.4.1106,R 版本 4.0.2]
由于 github 不允许通过用户名/密码进行身份验证,我在从 RStudio 推送项目更新时遇到了问题。
我设置了一个 github PAT 并将其安装在 .renviron
GITHUB_PAT=ghp.....
检查,使用usethis::sitrep(),看起来一切正常,AFAICS:说“发现个人访问令牌”
> usethis::git_sitrep()
Git config (global)
* Name: 'Michael Friendly'
* Email: 'friendly@yorku.ca'
* Vaccinated: TRUE
i Defaulting to 'https' Git protocol
* Default Git protocol: 'https'
GitHub
* Default GitHub host: 'https://github.com'
* Personal access token for 'https://github.com': '<discovered>'
* GitHub user: 'friendly'
* Token scopes: 'gist, repo, user, workflow'
* Email(s): 'friendly@yorku.ca (primary)', 'michael.friendly@gmail.com'
Git repo for current project
* Active usethis project: 'C:/R/Projects/HistDataVis'
* Default branch: 'main'
* Current local branch -> remote tracking branch:
'main' -> 'origin/main'
GitHub remote configuration
* Type = 'ours'
* Host = 'https://github.com'
* Config supports a pull request = TRUE
* origin = 'friendly/HistDataVis' (can push)
* upstream = <not configured>
* Desc = 'origin' is both the source and primary repo.
Read more about the GitHub remote configurations that usethis supports at:
'https://happygitwithr.com/common-remote-setups.html'
>
然而,当我尝试推送到 github 时,系统会提示我一个用户 ID/密码对话框,但由于 github 拒绝密码身份验证而失败。
进一步检查:GITHUB_PAT 好像没问题,
> Sys.getenv("GITHUB_PAT")
[1] "ghp_T..."
>
可能出了什么问题?否则我该如何测试?我该怎么做才能解决这个问题?
【问题讨论】:
-
gist.github.com/z3tt/3dab3535007acf108391649766409421 有一个很好的关于如何设置的描述。但是它对我不起作用。
标签: authentication github rstudio