ropensci/git2r

Should https remotes work to push to?

Closed this issue · 8 comments

@stewid We're having a bit of trouble pushing to https remotes, see ropensci/gistr#39

Is that something wrong in our setups? Maybe it's related to this #85

Hi @sckott

The problem is related to authentication. When you use gistr, you use a personal access token to authenticate over https. However, git2r doesn't support that yet. I'm not quit sure how to move forward with this, but it's an area that must be improved.

@stewid Thanks for the info. Okay. Maybe for now I can detect https remotes and warn users to switch to ssh remotes

@sckott I have added a new S4 class cred_env to hold environmental variables for the authentication. Have successfully used a GitHub PAT token to push over https.

remote_url(repo)
#> [1] "https://github.com/stewid/playground.git"
cred <- cred_env("GH_USER", "GH_PAT")
push(repo, credentials = cred)

Could you please try if this fixes ropensci/gistr#39

Great. On vacation for a week. Will try when back

@stewid it does seem to work, thanks very much!

@stewid does this help #131 at all? waiting on fix for that before including in gistr ropensci/gistr#50

@sckott great that it works :)
It´s not directly related to linking libssh2 in #131. However, I have made several improvments internally that are useful, see #152.

thanks for the link