Introduction to using Git and GitHub for software development

This course introduces the version control system Git, an essential tool for tracking and managing software development. Working with Git provides the flexibility to freely make changes to your code and the security to know you can always get back to a working state. You will learn to track the changes you made to your code and when you made them, both using the command line and graphical tools.

Beyond working on your own code, understanding Git allows usage of online code repositories such as GitHub. Using an online repository to publish your code is a great way to disseminate your research and a necessary step to collaborate with others. This course will demonstrate how to publish code to GitHub and introduce some of its basic features and functionality, while the Intermediate course introduces more features that make it a productive collaborative environment.

This course (particularly the first half) is closely based on this Code Refinery lesson.


Learning outcomes

After completing this workshop, you will be better able to

  1. Use the version control software Git to record and track changes to a code base
  2. Publish your code to a public repository
  3. Maintain your code repository up to date and in sync with your local copy
  4. Manage project action items with GitHub Issues
  5. Use a graphical user interface to Git
  6. Understand how and where to access support from the Research Computing Service at Imperial College

Delivery of the course

Material will be delivered as a lecture with tasks for you to complete, following the Carpentries teaching style.


Any introductory (graduate school) level programming course


Setup Download software and files required for the lesson
00:00 1. Why use a Version Control System? What is version control software?
Why should I use it?
00:10 2. Committing and History How do I start a project using Git?
How do I record changes made in a project?
How do I view the history of a project?
How can I correct mistakes I make with Git?
01:00 3. Sharing your code How can I share my code with others?
What should I take into account when sharing my code?
01:20 4. Remote repositories Is my local repository the same as the remote one?
How can I send my local changes to the remote one?
How can I get the changes others have made?
01:55 5. Using GitHub Issues How can I use GitHub issues to manage a TODO list for my project?
02:20 6. Using GUIs and IDEs What other ways can I interact with Git other than at the command line?
What tools are available for using Git?
When is it better to use each method of interacting with Git?
03:00 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.