Usethis: `git2r` doesn't support ssh protocol in default

Created on 26 Apr 2020  ยท  2Comments  ยท  Source: r-lib/usethis

When running usethis::use_github() with options(usethis.protocol = "ssh"), it invokes git2r and tries to push the commits to remote. However, git2r from CRAN (at least on macOS) doesn't support ssh protocol by default, see also https://github.com/ropensci/git2r/issues/415

It leads to silent failure as

r$> usethis::use_github()
โœ” Checking that current branch is 'master'
โ— Check title and description
  Name:        foobar
  Description: What the Package Does (One Line, Title Case)
Are title and description ok?

1: Yup
2: Nope
3: Absolutely not

Selection: 1
โœ” Creating GitHub repository
โœ” Setting remote 'origin' to '[email protected]:randy3k/foobar.git'
โœ” Adding GitHub links to DESCRIPTION
โœ” Pushing 'master' branch to GitHub and setting remote tracking branch
โ— Failed to push and set tracking branch.
  This often indicates a problem with git2r and the credentials.
  Try this in the shell, to complete the set up:
  `git push --set-upstream origin master`
โœ” Opening URL 'https://github.com/randy3k/foobar'

One solution that I see is to use https://github.com/r-lib/gert instead.

git

Most helpful comment

Believe me, replacing git2r with gert -- to get better control and visibility into credential management -- is our biggest and highest-priotiy meta-issue and WILL happen ๐Ÿ˜

But I guess we don't have an issue for it, yet.

All 2 comments

Believe me, replacing git2r with gert -- to get better control and visibility into credential management -- is our biggest and highest-priotiy meta-issue and WILL happen ๐Ÿ˜

But I guess we don't have an issue for it, yet.

@randy3k BTW the usual thing to do here, in the meantime before we switch to Gert, is to install git2r as a source package (vs. binary). Either via install.packages() or devtools::install_github().

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hadley picture hadley  ยท  5Comments

jennybc picture jennybc  ยท  4Comments

chris-billingham picture chris-billingham  ยท  5Comments

aosmith16 picture aosmith16  ยท  5Comments

atheobold picture atheobold  ยท  7Comments