Learning Version Control with GitHub: Part 2: Using GitHub

Learning Version Control with GitHub

Using GitHub

As introduced in a previous part, Github is:

a website that uses Git to track things in repositories. In Git, a repository, sometimes called a “repo” for short, is a collection of files. Users can create them, add collaborators, and even work across repositories as well.

Private repositories cost usually money to use on GitHub, but public repos can be created for free for those who have accounts on the site.

Creating an Account

Screenshot 2018-09-26 11.37.09

Visiting Github.com prompts to a create a username and password and supply an e-mail address.

Creating an account will cause GitHub to send an e-mail.

Screenshot 2018-09-26 11.42.57

In a new tab, window, or separate application, open the e-mail account used for signing up and find the e-mail GitHub sent. Click on on “Verify email address” within the message.

Close the new tab or window created by verifying the account and return to the previous one.Screenshot 2018-09-26 11.40.58

Click on “Create an account”.

Screenshot 2018-09-26 11.41.21

Make sure “Unlimited public repositories for free” is selected and click the “Continue” button.

Screenshot 2018-09-26 11.48.34

On the next screen, fill out the information or click “skip this step” to ignore the survey.

Forking a Repository

Screenshot 2018-09-26 12.10.58

While projects can be created and used on GitHub, one of the most common actions is to fork a project someone else or a group created. In Git terminology, forking a project means to copy their project into your account.

While logged into GitHub, visit the repo Learning GitHub

Screenshot 2018-09-26 12.13.46

Click on the “Fork” button in the upper, right-hand corner.

Screenshot 2018-09-26 12.14.44

GitHub will clone the files from one repository to another.

GitHub Desktop Application

Screenshot 2018-09-26 12.16.49

While projects can be managed from the website version, it is often more convenient to work on files on a local device and then upload them to the website. This allows for working on files without needing to be connected to a network and to make all changes before submitting them.

There is a desktop application for GitHub named GitHub Desktop. It can be found on its own site.

GitHub Apps - Login

Once downloaded and installed, opening the application will prompt for a login. Click on “Sign into GitHub.com”

GitHub - Signin

Enter the same username and password used when signing up on GitHub.

GitHub - Configure Git

The GitHub Desktop application will guess at a name and create a unique, new e-mail address for using Git. Click “Continue”

GitHub - Make better

Finally, choose to send anonymous usage data or not by unselecting or leaving the “Yes, submit anonymized usage data” select blank or not. Click “Finish” to continue.

Cloning a Repo

GitHub - None Found

By default, there will be no repositories found. To fix that, click on “Clone a repository” to download files from GitHub to the local device.

GitHub - Clone Repo

Select the “Learning-GitHub” repo forked earlier.

Note the location in the “Local Path” area of where the files will be stored. To change this, click “Choose…” and file another folder or directory for the files.

Click “Clone” to download the files.

GitHub - No changes

On the right-hand side, the GitHub Desktop application will note that there are “No local changes.” Since the files where just cloned, this makes sense. No changes have been made yet.

As part of working with GitHub, the GitHub Desktop application watches for file changes and helps with managing version control of these files.

GitHub - Open Explorer

Clicking on “open this repository in Explorer” will open the folder or directory holding the files. With only a single README.md, there are no other files or changes right now.