Creating a Cohort-Specific GitHub Repository with Kyber
github-repo.Rmd
Configure GitHub
Make sure your computer is configured according to the instructions
in vignette("configuration")
. Run the following code to see
if your GitHub credentials are set up:
If credentials are detected you should get a result like:
<gitcreds>
protocol: https
host : github.com
username: PersonalAccessToken
password: <-- hidden -->
Creating the Repository
Each Champions Cohort has its own GitHub repository. The name of the
repository should match the corresponding cohort_name
in
the Cohort Registry. The init_repo()
function in the code below will do the following:
- It checks to see if the GitHub repository you are trying to create already exists. If it does exist, it will result in an error.
- It tries to initialize a GitHub repository on your computer. If that
repository already exists in the
path
argument, it will result in an error. No repository will have been created on GitHub. - It will then create the local Git repository, add a code of conduct
(via
add_code_of_conduct()
), add a.gitignore
file (viaadd_gitignore()
), and thengit add
andgit commit
those files beforegit push
-ing those files to GitHub. - Finally it will create a
README.Rmd
file in the repository for you to edit.