Lessons · Coding · beginner · Programming with Mosh

Git Tutorial for Beginners: Learn Git in 1 Hour

The video “Git Tutorial for Beginners: Learn Git in 1 Hour” by Programming with Mosh as 10 lessons, with the idea explained, the code from the screen, steps to try in the practice terminal, practice problems with solutions and a quiz that leads back to the moment.

10lessons
18pieces of code
19exercises
24questions
69min of video
Open the lessons →Lesson 1 is free · Beyond Pass opens all
Git Tutorial for Beginners: Learn Git in 1 Hour, video by Programming with Mosh▶ 1:09:13 · Programming with Mosh
12345678910
0:0010 lessons across the whole video1:09:13

You will be able to

  • Install Git and configure your name and email for commits
  • Create a repository and record changes with add and commit
  • Inspect project history and compare changes with log, status and diff
  • Ignore unwanted files with a .gitignore file
  • Undo and restore changes safely using restore and reset
  • Create, switch and merge branches and resolve simple merge conflicts

Good to know first

  • Basic comfort using a terminal or command line
  • Ability to create and edit files in a text editor
  • A GitHub account for the remote repository section

Syllabus

10 lessons and a final project

  1. 1

    Introduction to Git and installing it Free

    0:00–3:003 min of video

    This lesson explains what a version control system is and why Git is a distributed one that is free, open source, fast and scalable. It also prepares you to install Git on your own computer.

  2. 2

    Configuring Git and creating a repository Beyond Pass

    3:00–9:206 min of video

    You will tell Git who you are, then turn a folder into a Git repository with git init. You will learn why Git needs your name and email before it records any work.

    1 code4 build steps2 exercises2 questions
  3. 3

    Staging files and making commits Beyond Pass

    9:20–16:407 min of video

    You will learn how to set up Git's global configuration (your name, email, editor and line-ending behaviour) and how to save snapshots of your work with git add and git commit. Along the way you will see how a commit message describes a change.

    3 code4 build steps3 exercises3 questions
  4. 4

    Viewing history and comparing changes Beyond Pass

    16:40–23:207 min of video

    This lesson introduces the three areas of the Git workflow (working directory, staging area, repository) and shows how files move between them with git add and commit. It also starts the hands-on part by creating a file in a Git project so you can see Git track it.

  5. 5

    Ignoring files with .gitignore Beyond Pass

    23:20–30:007 min of video

    You learn how to tell Git which files and folders to ignore, using a .gitignore file so they never get staged or committed by accident. The chapter also shows the first commit in the Moon project and a few tips on writing good commit messages.

    1 code4 build steps2 exercises3 questions
  6. 6

    Undoing Changes with git restore and git reset Beyond Pass

    30:00–38:208 min of video

    You will learn how to throw away unwanted edits to files with git restore, and how git rm and git status help you handle deleted and renamed files. You will also see how a .gitignore file keeps junk files out of your commits.

    6 code5 build steps1 exercise3 questions
  7. 7

    Working with branches: Unstaging and checking status Beyond Pass

    38:20–48:2010 min of video

    This lesson covers how to remove files from Git's tracking and how to read short status output while you work on a project. It follows the video's examples of ls-files, git rm, and git status -s.

    3 code4 build steps2 exercises3 questions
  8. 8

    Reviewing changes with git diff and git difftool Beyond Pass

    48:20–56:408 min of video

    This lesson shows how to look at what has changed in your files before you commit, using git diff and git status -s. It also shows how to set up VS Code as a visual diff tool with git difftool.

    2 code6 build steps3 exercises3 questions
  9. 9

    Viewing Commits and Looking Inside the Repository (Git) Beyond Pass

    56:40–1:05:008 min of video

    This lesson shows how to inspect a past commit with git show and git log, and how to look at the files a commit stored with git ls-tree. You will learn to read the difference a commit made, and to use HEAD and HEAD~1 to point at commits.

    1 code5 build steps3 exercises4 questions
  10. 10

    Restoring a Deleted File and Wrapping Up Git Beyond Pass

    1:05:00–1:09:134 min of video

    You learn how to bring back a file you deleted by restoring it from an earlier commit, using git restore with --source and HEAD~1. The chapter also recaps the core Git workflow and points you to where to go next.

    1 code4 build steps3 exercises3 questions

Final project

Build and Rescue the Moon Project

Create a small project from scratch and manage it with Git the way the course shows. You will record history, ignore junk files, make and undo mistakes, and then use a branch with a merge conflict. This ties the whole workflow together.

Its 7 tasks open with Beyond Pass.

Free preview · Lesson 1 in full

Introduction to Git and installing it

This lesson explains what a version control system is and why Git is a distributed one that is free, open source, fast and scalable. It also prepares you to install Git on your own computer.

0:00 to 3:00 in the video

Scratchpad

Draw and write next to the video.

On your scratchpad

Draw two boxes labelled 'Centralized' and 'Distributed'. In the centralized box, draw one central server with several developers connecting to it. In the distributed box, draw each developer with their own full copy of the repository, and a

Open lesson 1, with the video →

Lessons 2–10 and the final project

They open with Beyond Pass: every lesson of every course, in full. One payment: $14.99 for 90 days or $29 for a year. No subscription.

Made by Beyond from the video “Git Tutorial for Beginners: Learn Git in 1 Hour” by Programming with Mosh. The video plays in YouTube's own player. Watch it on YouTube · All lessons