Appendix D — Extras: About GitHub
D.1 Manually create a repo on GitHub
Open up GitHub in a browser, make sure you are logged in, and create a new, empty repository. New repositories can be created by either clicking the green “New” button on the left sidebar or by clicking the +
symbol at the top right to open a menu and selecting the “New repository” item.
You’ll be sent to a screen with some options for the new repository. For now, type out learning-github
as a name for the repository and leave everything else blank. Make the repository “Private” for now. The video below can be used as a reference.
Ok, we now have a remote repository to work with. The next step depends on whether you have an existing repository with a history or you are starting completely from new. If you haven’t created a Git repository and saved to its history locally, the easiest way of getting your GitHub repository onto your computer as a local repository is to download it (or to “clone” it in Git terms). You can “clone” a GitHub repository easily from RStudio’s “Create Project from Version Control” interface. We’ll do that now, as detailed in the videos below. Where you save the new project doesn’t matter, but to make things easy, save it to the Desktop.
First we will find our repository link and create a new project from version control.
When attempting to clone your repository, GitHub will require you to authenticate yourself. In most cases when using GitHub, you can use the password created during signup. However, when indirectly communicating with GitHub using RStudio, we need to use a “Personal Access Token” (PAT).