TutreNews Learn

Git Fundamentals: Version Control

Track changes, undo mistakes and collaborate with Git. Understand the working tree, staging area and commits, use branches and merges, resolve conflicts and work with remote repositories.

Beginner · 3 units · 8 lessons · 55 exercises · ~1.1 h

What you will learn

  • Explain the working tree, staging area and repository
  • Record, inspect and undo changes safely
  • Create, merge and clean up branches; resolve merge conflicts
  • Clone, pull and push with remote repositories

Prerequisites

  • Basic use of a terminal (cd, ls)

Learning path

1 Recording changes

  1. What Git does7 min · 4 exercises
  2. Stage and commit9 min · 4 exercises
  3. Reading history7 min · 4 exercises
  4. Unit exam5 exercises

2 Undoing and ignoring

  1. Undoing changes safely10 min · 4 exercises
  2. Ignoring files6 min · 4 exercises
  3. Unit exam5 exercises

3 Branches and merging

  1. Working with branches8 min · 4 exercises
  2. Merging and conflicts10 min · 4 exercises
  3. Remote repositories9 min · 4 exercises
  4. Unit exam5 exercises
  1. Final exam8 exercises

Practical project: Version a small website with a teammate workflow

  1. Create a repository for a small website (e.g. the page from the HTML course) and make an initial commit with a README.md and a .gitignore.
  2. Create the branch about-page, add an about page in two separate, well-described commits, and merge it into main.
  3. Provoke a conflict on purpose: on a new branch change the main heading; on main change the same heading differently; merge and resolve the conflict.
  4. Undo practice: make a bad commit and reverse it with git revert.
  5. Push the repository to a hosting service of your choice and verify with git log --oneline --graph --all that the history shows the branch and merge commits.

References

Related courses