2.3 Repositories

When you access a repository on GitHub, the page will look similar to the screenshot below,

The page contains a lot of information about the repository along with multiple tabs and buttons, which can be a bit overwhelming at first. As it turns out, we will not need to use many of these tabs or buttons during the class, so instead let’s focus on the most important ones, which have been highlighted in the red and blue rectangles.

  • Red
    • Code tab: Clicking this brings you back to the main repository page, which is what is displayed in the above screenshot
    • Commit tab: takes you to the commit history for the repository, which are the series of “snapshots” that you create using the git tool in RStudio
  • Blue
    • Dropdown branch menu: use this to inspect a branch that is different from the default master branch
    • Clone or download button: provides a link to use when obtaining a copy of a repository. For the class, you will do this by creating a new project in RStudio using the version control option.
    • Pull requests tab: generally used for code reviews and quality control when a user wants to contribute code to a repository. For the class, pull requests will be used to submit your work so that the instructor is able to leave line-by-line comments about your code.

Below the tabs and button is a list of files stored in the repository,

Each repository will have different files. Clicking a file’s name will bring you to another page that shows a preview of the file contents. The descriptions in the middle of the file list show the most recent commit message for each file and the timespan on the right shows how recently the file was last updated.

The above file list also shows you what you’ll see in a folder after you first obtain a copy of the repository. In that way, each repository can be thought of as a folder containing files,

The advantage of this approach is that each repository you create is isolated and separate, which helps to reduce certain kinds of coding errors.

Below the repository file list is a rendered version of the README.md file,

The README.md file describes the contents of the repository and can be used as a form of documentation. It is a good idea to look at the README.md file of any repository you visit on GitHub to see if it gives examples or quick instructions on how to set up and use the files.