Home Getting started with GitHub
Post
Cancel

Getting started with GitHub

It makes sense to start the blog with a post about the elephant in the room. This post, and the ones that will hopefully follow, would not have had a place on the web without GitHub and its Pages. Well, there might have been other venues to air them, but none that I know were as easy to use as GitHub Pages.

In this post, we will discuss how to get started with git and GitHub. You, the reader, might want to complete some prerequisites before you can follow along. For the sake of clarity, I will list the requirements in the following subsection.

Prerequisites:

  • Download and install git for Windows/Linux. This link should (or did at the time of writing this post) take you to the webpage where you can download git’s Command Line Interface (CLT) client1. After successfully downloading the executable file, follow the installation wizard to get git installed on your system.
  • Register a free GitHub account2.

Start on GitHub:

You can always add version control (in the form of git) to an existing project at any time. On this occasion, we will start our version control (GitHub repository) before we create/script any project-related files.

  • Login to your GitHub account.
  • Locate the plus + sign on the top right corner of the page and select New repository.
  • On the next page, give your repository a name under the Repository name field3. I will call this repository getting-started-with-github.
  • You can add a few sentences to the Description field. I will add this is test repo that is meant to serve a GitHub pages post.
  • Choose between having your repository Public for anyone to see or Private for you to invite people to view and/or contribute. I will make this repository Public so that you, the reader, can access it.
  • Check the box next to the Add a README file so GitHub can create that file for you.
  • Next, we can add a .gitignore file to our project repository. A .gitignore is a utility file that helps git keep track of the files you want it to ignore4. I will choose a .gitignore template for the statistical programming language R.
  • Finally, to finish creating this repository you, can choose a license to govern the use of its contents by other users. I will select the MIT License5 for this repository.
  • Click on Create repository and wait a second for GitHub to create your repository.

A new webpage should now load, and you should see your repository with three files (.gitignore, LICENSE and README.md). Also, just below these files, you should see the contents of the README.md file.

Created repository

Some code

# load plumber
# library(plumber)
  1. git has both CLT and Graphic User Interface (GUI) clients; however, I will be using git from the command line prompt, which means that we only need git’s CLT client (at least for now). 

  2. You can always get a/subscribe for a pro version, but a free would work just fine for now. 

  3. If you have already created/imported repositories in/to your GitHub account, give your repository a unique name. GitHub will inform you if you entered an acceptable and/or available name. 

  4. Since this option adds a .gitignore template, it depends on the programming language you intend to use in your project. 

  5. The MIT License is a very common license that is compatible with many copyleft licenses, such as the GNU General Public License (GNU GPL). Any software licensed under the terms of the MIT License can be integrated with software licensed under the terms of the GNU GPL. Unlike copyleft software licenses, the MIT License also permits reuse within proprietary software, provided that all copies of the software or its substantial portions include a copy of the terms of the MIT License and also a copyright notice. 

This post is licensed under CC BY 4.0 by the author.