not able to push to github with `gert` or `git2r`

Viewed 36

I'm trying to use gert or git2r to use git programmatically from R, but on git2r::push() I get:

Error in 'git2r_push': failed to send request: A connection with the server could not be established

or rather on gert::git_push() I get:

Error in libgit2::git_remote_push : 
  failed to send request: A connection with the server could not be established

I am behind a proxy, but pushing works fine from the terminal or from RStudio. The 'situation report' also looks fine:

> usethis::git_sitrep()
Git config (global)
* Name: 'xxxxxxxxxxxxxx'
* Email: 'xxxxxxxx@xxx.xxx'
* Global (user-level) gitignore file: <unset>
* Vaccinated: FALSE
i See `?git_vaccinate` to learn more
i Defaulting to 'https' Git protocol
* Default Git protocol: 'https'
* Default initial branch name: 'master'
GitHub
* Default GitHub host: 'https://github.com'
* Personal access token for 'https://github.com': '<discovered>'
* GitHub user: 'xxxxxxxxxxxxxx'
* Token scopes: 'gist, repo, workflow'
x Token lacks recommended scopes:
  - 'user:email': needed to read user's email addresses
  Consider re-creating your PAT with the missing scopes.
  `create_github_token()` defaults to the recommended scopes.
x Can't retrieve registered email addresses from GitHub.
  Consider re-creating your PAT with the 'user' or at least 'user:email' scope.
Git repo for current project
* Active usethis project: '//xxxxxxxxxxxxxx/public$/Avtomatizacija/xxxxxxxxxxxxxx'
* 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 = 'xxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxxx' (can push)
* upstream = <not configured>
* Desc = 'origin' is both the source and primary repo.

===================================================================
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default

locale:
[1] LC_COLLATE=Slovenian_Slovenia.1250  LC_CTYPE=Slovenian_Slovenia.1250   
[3] LC_MONETARY=Slovenian_Slovenia.1250 LC_NUMERIC=C                       
[5] LC_TIME=Slovenian_Slovenia.1250    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] git2r_0.30.1 gert_1.6.0  

loaded via a namespace (and not attached):
 [1] fansi_1.0.3       utf8_1.2.2        crayon_1.5.1      sys_3.4           lifecycle_1.0.1  
 [6] magrittr_2.0.3    credentials_1.3.2 pillar_1.7.0      rlang_1.0.3       cli_3.3.0        
[11] rstudioapi_0.13   vctrs_0.4.1       ellipsis_0.3.2    tools_4.1.2       glue_1.6.2       
[16] compiler_4.1.2    pkgconfig_2.0.3   askpass_1.1       openssl_2.0.2     tibble_3.1.7  
0 Answers
Related