Git and GitHub Tutorial
Learn Git from your first commit to pull requests, with real command output and safe ways to undo mistakes
Beginner4 lessonsabout 26 min of reading
This course is for anyone who has to share code with other people and has been getting by with copy-paste folders or a handful of memorised commands. No prior version-control experience is needed, only a terminal and Git installed. Every transcript in the lessons is real output from a throwaway repository, so you can reproduce each step.
You will understand the three areas Git keeps your work in, make small well-described commits, branch and merge including conflicts, work with a remote and a pull request workflow, and undo mistakes without losing work. The lessons stay hosting-neutral where they can, and the one GitHub-specific part (pull requests) is marked.
The order follows how you meet Git at work: first your own repository and commits, then branches and merging, then sharing through remotes and pull requests, and last how to recover when something goes wrong. For a team context, pair this with Collaborating in a Team and CI/CD.
Git and GitHub lessons
- 1Git Basics: Working Tree, Staging Area and Your First CommitsLearn Git basics with real command output: the working tree, staging area and commit history, how git add and git commit differ, and how to write good commits.6 min read
- 2Git Branches and Merging: Fast-Forward, Merge Commits and ConflictsLearn Git branches and merging with real output: create and switch branches, tell fast-forward from merge commits, and resolve a merge conflict step by step.6 min read
- 3Git Remotes, Pull Requests and a Team Workflow on GitHubGit remotes explained with real output: clone, push, fetch and pull, fix a rejected push with pull --rebase, then pull requests and a GitHub team workflow.7 min read
- 4Undo Changes in Git: Restore, Revert, Reset and Reflog ExplainedHow to undo changes in Git safely: restore, amend, revert, reset modes and reflog recovery, with real output and a force-with-lease example for pushed commits.7 min read
Preparing for an interview? Practise DevOps interview questions
Learning Git and GitHub to land a job? Browse open roles or check which skills are trending.