0

I'm trying to use git2r package in R to commit and push a file to my repository.

The code I'm using is like that:

# Clone existing github repo using url and linking this to your project path
clone(url = "https://github.com/path/repository", local_path = my_path)

# Assign variable repo as current local repository
repo <- repository(my_path)

# Configure access rights with github username and profile
config(repo, user.name='my_name', user.email= 'my_email')

# Setting my SSH credentials
cred <- git2r::cred_ssh_key(ssh_path("id_rsa.pub"), ssh_path("id_rsa"))

# Stage changs to commit
add(repo, "my_file.html")
commit(repo, "Commit message")

# Push changes
push(repo, 'origin', 'refs/heads/master', credentials = cred)

When pushing, I receive the following error:

Error in push(repo, "origin", "refs/heads/master", credentials = cred) : 
  Error in 'git2r_push': config value 'http.followRedirects' was not found

No idea what could be wrong. I haven't found much on internet about this error or what configuration is that. It looks like a simple issue, but I can't figure it out.

Any help is pretty much appreciated.

jpsmith
  • 11,023
  • 5
  • 15
  • 36

0 Answers0