These exercises follow the material in the GitHub section of Reproducible
R.
- Command line Git
- Create a new folder called GitHub_Training, and turn it into a git
repository using the git command line.
- Create a README.md. Write in the name of a TV show.
- Copy the dayOfWeek Rscript from the data directory to the
GitHub_Training directory.
- Add and commit each the README and the Rscript separately.
- Create a project on GitHub. Add this as a remote to your local Git
for GitHub_Training.
- Push changes up to the remote.
mkdir GitHub_Training
cd GitHub_Training
git init
touch README.md
echo 'The Twilight Zone' >> README.md
cp ../data/dayOfWeek.r .
git add README.md
git commit -m"create README"
git commit -m"add days of week script"
git remote add origin https://github.com/BRC-RU/GitHub_Training.git
git push origin master
- RStudio Git Integration
- Create a version controlled R project. Link this to your
GitHub_Training remote. Save this in a different place to the Git
repository you created in section 1 with command line Git.
- Update the README.md to include the name of a movie.
- Create a new Rmarkdown. Within this source the dayOfWeek Rscript.
Add session information. and then compile the Rmarkdown to HTML.
- Update the .gitignore so Rmd files are ignored.
- Stage and commit changes through RStudio. Remember to not commit
every change together. Commit changes that make sense
together.
- Push changes up to GitHub.
- Workflow and Collaboration Next we will practice the GitHub
workflow. To do this we will use the repository here. This is
my collection of GIFS for how this training session makes me feel, and
you can add to this.
Contribute to the issues. Either create a new one, or add
comments to existing issues.
Take a fork of the repository. You can create a local copy
through RStudio or command line git.
Find GIF that you like. (GIPHY
has lots of options). Copy the URL.
Open up the README.md document. Add a line to insert you GIF to
the README.md. An example line is here: <img src=“https://my_gif_url_here.gif” width=“300”/>
Create a pull request to merge your fork back into the main
repository.