Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stewid/test-07

Test to add an existing project to GitHub using SSH and git2r on Windows
https://github.com/stewid/test-07

Last synced: 27 days ago
JSON representation

Test to add an existing project to GitHub using SSH and git2r on Windows

Awesome Lists containing this project

README

        

# Add an existing project to GitHub using SSH and git2r

Create a new repository on GitHub before running the following R code.

```r
library(git2r)

# 1) Create a new repository
repo <- init("test-07")

# 2) Add 'README.md' to local repository
add(repo, "README.md")

# 3) Commit staged 'README.md'. Add sessionInfo to commit message
commit(repo, message = "Initial commit", session = TRUE)

# 4) Add URL for the remote repository
remote_add(repo, "origin", "[email protected]:stewid/test-07.git")

# 5) Create SSH credentials
cred <- cred_ssh_key("~/.ssh/id_rsa.pub", "~/.ssh/id_rsa")

# 6) Push changes in local repository to GitHub
push(repo, "origin", "refs/heads/master", credentials = cred)
```