Skip to Main Content
Library Logo WOU Home Library Home
Search the library catalog (Primo)
Search WOU Digital Collections

Using Git and GitHub for Version Control: Using Github from the Command Line

Describes how to use Git (a versioning control system) and GitHub (a web-based git repository) to track changes to your code.

Command Line Basics

The command line is a text-based interface for a computer or network. Although computers today have graphical user interfaces which make using them easier, you can still access the command line.

Windows

In Windows operating systems, you can access the command line from the Command Prompt program.

The instructions for accessing the Command Prompt differ by Windows version, but it can usually be found by opening the start bar and typing cmd or doing a search for cmd.exe

MacOS

In MacOS, the command line is accessed using the Terminal app.

Terminal can be found in the utilities folder or by searching for Terminal in the spotlight.

Linux

Like in MacOS, Linux distros use a program called Terminal to access the command line, which is located in the Utilities folder.

In some Linux distros, you can access Terminal by right-clicking on the desktop.

Need help getting around?

This cheat sheat from Tobias Gunther at Git Tower describes the most common commands that are used in the command line, such as changing directories, accessing and manipulating files, permissions and basic network commands.

Using GitHub from the Command Line

Using GitHub from the command line is complicated, and may require you to access GitHub from either the website or desktop version at some points in the process.

​The GitHub help documentation has information on using the command line.

Managing Files Using the Command Line - Includes information on adding, renaming, and moving files.

Importing a Repository - How to import an existing repository into GitHub.

Adding an Existing Project to GitHub - A more detailed version of the above, for mature projects.

Create a Project Page - Instructions on creating a projects page for your project.

The GitHub cheat sheet is an official GitHub publication, which describes the most commonly used commands for using git with GitHub.

Download the GitHub cheat sheet in PDF.

Hub

Hub is a tool that makes GitHub easier to use from the command line.

You can find instructions to install it in various operating systems here: https://github.com/github/hub

Alternately, if you want to install from an executable, check out https://github.com/github/hub/releases