Follow

How does GitHub work? What does it mean to checkout code?

We integrates with GitHub to make it even easier for you to follow changes in the sample code for your courses as it evolves between steps. Git is a version control system which makes it easy to manage different versions of a files in a project, like our code examples.

The collection of files belonging to a project are called a repository. Our course repositories are hosted on GitHub, which makes it easy to access the code from anywhere and see changes visually with its web interface.

Download the code

The simplest way to access the working files for your course is to download the sample code directly to your computer — just click “Download the sample code” and you’ll get all the relevant code packaged up in a single ZIP file.

Checkout the code with Git

If you’re familiar with Git, you might prefer to checkout the code from the course’s Git repository directly, using the tag specific to the lesson. You’ll be set up with the most relevant version of the project automatically, with ability to switch between lessons easily.

To checkout a lesson’s code using Git, you first need to know the name of the tag you want to use. All tags use a simple naming convention lesson, based on the lesson number and step. For example, lesson 2, step 1 would be tagged lesson2.1.

The best way to set up git checkout is to create a new branch in your local repository based on a given tag — for example git checkout -b mywork lesson2.1.

See what changes in each lesson

GitHub also allows you to see how the lesson's code changes - just click the "View Changes" button. This will show you a so-called diff view, comparing the start and end state of the step. Lines highlighted in red with a minus mean a line has been removed, whereas green lines starting with a plus indicate new additions to the code.

 

Comments

Powered by Zendesk