Skip to content

stewid/test-02

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 

Repository files navigation

Add an existing project to GitHub using https and git2r

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

library(git2r)

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

# 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", "https://github.com/stewid/test-02.git")

## 5) Create credentials from environmental variables
cred <- cred_env("GITHUB_USER", "GITHUB_PAT")

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

About

Test to add an existing project to GitHub using https and git2r on GNU/Linux

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published