Instructor: Generalist Programmer |
Runtime: 16:21 mins |
Students / Views: 360,311
Git and GitHub crash course 2026: init, commits, branches, merge vs rebase, pull requests and undoing mistakes — beginner to daily-driver.
βΆ Full written tutorial (free): https://generalistprogrammer.com/tutorials/git-cheat-sheet?utm_source=youtube&utm_medium=description
Git and GitHub, explained from absolute zero. By the end of this crash course you
will understand what git actually is, make your first repository and commits,
branch and merge, push to GitHub, open a pull request, and — the part almost
nobody teaches beginners first — use the disaster-recovery safety net, so nothing
you break is ever truly lost. No prior experience needed. We go in the order you
would actually learn it.
What's covered:
- What git is: a distributed version control system. A repo is your project plus
its full history of snapshots (commits). Git is local-first — your history lives
in a hidden .git folder on your machine. GitHub is a remote that hosts a copy of
your repo so you can back it up and collaborate. Git is the tool; GitHub is a
place to put it (GitLab and Bitbucket do the same job).
- Your first repo and commits: git init (start a repo, once), git status (what
changed and what's staged), git add FILE or git add . (stage), git commit -m
"message" (snapshot), git log --oneline (history). The three areas: working
directory to staging area (the index) to repository.
- Branches: a branch is a movable pointer to a commit. git branch NAME (create),
git switch -c NAME (create and switch), git switch main (go back); git checkout
is the older way. Why branch — isolate work so main stays stable.
- Merge vs rebase: git merge NAME keeps both histories and adds a merge commit
(safe on shared branches). git rebase main replays your commits on top of main
for a clean linear history but REWRITES their hashes — so never rebase commits
others already have (local-only).
- GitHub and pull requests: git remote add origin URL, git push -u origin main
(first push sets upstream), git clone URL, git pull. A pull request proposes
merging your branch into main so teammates review before it lands. Fork vs clone.
- The undo safety net: git commit --amend (fix the last commit), git reset --soft
or --hard HEAD~1, git revert SHA (safe on shared branches), and the star of the
show, git reflog, which recovers "lost" commits with git reset --hard HEAD@ n.
Nothing you commit is ever truly lost.
- The daily workflow: pull, branch, commit, push, open a PR, merge, delete the
branch — the loop real teams run. Plus .gitignore to keep secrets and build
artifacts out of your history.
Free git and GitHub cheat sheet (every command here):
https://generalistprogrammer.com/tutorials/git-cheat-sheet?utm_source=youtube&utm_medium=description
Deep dive on undoing a commit:
https://generalistprogrammer.com/tutorials/how-to-undo-a-git-commit?utm_source=youtube&utm_medium=description
Want to go further? Git and GitHub Mastery Pack, 15 dollars, optional:
https://generalistprogrammer.gumroad.com/l/git-github-mastery-pack?utm_source=youtube&utm_medium=description
— Chapters —
0:00 Git & GitHub from zero
1:15 What is git?
2:48 Your first repo — init, add, commit
4:31 Branches
6:16 Merge vs rebase
8:00 GitHub — remote, push, clone, pull
9:40 Pull requests
11:14 The undo safety net
12:58 The daily workflow
14:38 Recap — the whole arc
#git #github #gitcrashcourse
Key Highlights & Overview:
Mastering <strong>Git Cheat Sheet Pull</strong> requires clear step-by-step guidance and practical hands-on visual demonstrations. Explore curated video courses, expert walkthroughs, and detailed lesson notes today on <strong>TutorTube</strong>.