r-lib / gert

Simple git client for R
https://docs.ropensci.org/gert/
Other
148 stars 32 forks source link

unable to push with `gert::git_push()` #178

Open majazaloznik opened 2 years ago

majazaloznik commented 2 years ago

I'm trying to use gert to use git programmatically from R, but ongert::git_push() I get:

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

Similar thing happens with git2r as well. I am behind a proxy, but pushing works fine from the terminal or from RStudio. The 'situation report' also looks fine I think, and I am unable to find anything useful on google, so would appreciate any pointers!

sitrep() & SessionInfo() ``` > usethis::git_sitrep() Git config (global) * Name: 'xxxxxxxxxxxxxx' * Email: 'xxxxxxxx@xxx.xxx' * Global (user-level) gitignore file: * 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': '' * 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 = * 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 ```
majazaloznik commented 2 years ago

I've tried setting git config --global http.proxy and https.proxy even though I already have them set using Sys.setenv() in my .Rprofile. But it is still not working