Learn Git and GitHub Step by Step

Git and GitHub is a beginner-level course of 5 lessons (about 3 h 5 min), with 15 exercises and 15 quiz questions. Prerequisites: Terminal and Command Line. The course needs a full project environment, planned for a later phase of the platform.

  • Foundations
  • Beginner
  • 5 lessons
  • 3 h 5 min
  • 15 exercises
  • Full project environment (phase 2)

The course in brief

Git is the essential tool for tracking a project's evolution and working as a team. This course has you practice in a real terminal: commits, history, undoing changes, branches and conflicts, then GitHub with remote repositories, pull requests and code review.

What you will be able to do

  • Create a repository and record clear commits using the staging area
  • Browse the history and undo a change with the right command
  • Work with branches, merge and resolve a conflict
  • Publish and synchronize a repository on GitHub with secure authentication
  • Contribute to a project through a pull request and take part in code review
  • Protect secrets with .gitignore and good practices

Syllabus: 5 lessons

    • Understand what a version control system is for
    • Configure Git and initialize a repository
    • Record changes with add and commit

    Git repositoryStaging areaCommit

  1. 02

    Explore the history and undo changes

    15 min
    • Browse the history and differences
    • Undo an unrecorded change
    • Undo a commit cleanly

    History (log, diff)Undo (restore, revert, reset)

  2. 03

    Branches, merges and conflicts

    20 min
    • Create a branch and switch between branches
    • Merge a branch into main
    • Resolve a merge conflict

    BranchesMergeConflicts

  3. 04

    GitHub: working with a remote repository

    20 min
    • Link a local repository to a GitHub repository
    • Send and retrieve commits with push, pull and fetch
    • Authenticate securely

    Remote repositorypush, pull, fetch, cloneGitHub authentication

  4. 05

    Collaborating: .gitignore, pull requests and review

    20 min
    • Exclude files from tracking with .gitignore
    • Propose a change with a pull request
    • Take part in a code review and adopt a team workflow

    .gitignorePull requestCode review

Final project

Run a team mini-project with Git and GitHub

Create a repository on GitHub for a small project (showcase website, analysis script or API, your choice). Manage it as in a company: issues for each task, one branch per task, reviewed pull requests (by a partner or by yourself with a checklist), resolution of at least one conflict and undoing a commit with git revert.

Deliverables

  • The URL of the GitHub repository with a README describing the project
  • A suitable .gitignore and a .env.example file if the project uses secrets
  • At least 3 issues and 3 merged pull requests, each linked to an issue
  • A history showing a merge commit resulting from a resolved conflict and a Revert commit

Assessment criteria

  • Commit messages are clear and follow a consistent convention
  • No secret or generated file is present in the history
  • Each pull request has a useful description and a reasonable size
  • The conflict is correctly resolved, with no markers left
  • Merged branches are deleted and main stays functional

Frequently asked questions

What is the difference between Git and GitHub?

Git is version control software that runs on your computer. GitHub is an online service that hosts Git repositories and adds collaboration tools such as pull requests.

Do I need to know the terminal before this course?

Yes, the basics of navigation and file handling on the command line are recommended: they are covered by the Terminal and Command Line course.

Is Git useful for data science?

Yes. It lets you version scripts and notebooks, compare experiments on branches and collaborate cleanly, while keeping sensitive data out with .gitignore.

Is a GitHub account required?

The first three lessons are done without an account. A free GitHub account is required for the lessons on remote repositories and pull requests.

This course, told for your job

Say what you want to be able to do: “Git and GitHub” takes its place in your path, with examples from your field. The concepts stay those of the course.

The preview is free, and you can take the courses one at a time without paying. The path only contains lessons from the catalogue.