
Overcome the fear of git by revisiting basics and visualizing git commands. This course helps developers who have used git before feel more confident when things go wrong.
Explore this visuals-first course with colorful shapes and animations, not for beginners, and its lack of guides or command-line focus, noting it does not cover installation, commit messages, or GitHub/Bitbucket.
Explore Git fundamentals, including commits, diffs, staging area, origin and remote branches, and the head and detached head concept. Understand merge vs rebase, reset types, and how conflicts are resolved.
Explore how git saves work as commits and commit objects, enabling version history, easy sharing with a team, and avoiding multiple copies of your project.
Debunk the belief that commits store diffs. Commits capture snapshots of the entire project, linking the working tree and the repository while preparing for the staging area.
Visualize git commit objects as hashes with parent and snapshot sections to understand hashes and parent-child relationships. Recreate commits with commands and view history using git log and git show.
Running git init creates a repository with the .git directory, staging area, head, master branch, objects, refs, index, stash, and a garbage collector, showing how these elements relate to commits.
Explore why the staging area (index) exists: stage a selective snapshot from the working tree before committing, tracking only the files you choose, while the staging area persists after commits.
Uncovers common misconceptions about the git staging area, showing that complete files reside there and that added items persist until you explicitly remove them, even as you modify files.
Learn how git tracks files across the working tree, staging area, and repository, using unmodified, modified, staged, and modified and staged statuses.
Master how to manage evolving repositories by using the staging area, commit objects, and branches with head to integrate work, test features, and recover removed code.
Overcoming fear of git clarifies misconceptions about branches, such as how commits relate to branches, how merges affect master, and why deleting a feature branch can seem to obscure history.
Visualize git as a map where branches are pins pointing to commits, and the head can point to a commit or to a branch, with pins sharing a commit.
Delete a branch removes its pin and record from the repository, while commits shared with another branch stay; hanging commits are removed by the garbage collector after 30 days.
Learn how branches point to commits and how head marks the current location. Head moves forward with each new commit and updates the branch it points to.
Learn how git uses head and master, creates commits with parent hashes, and moves branches through check out and branch creation to illustrate branching and navigation.
Explore how git checkout updates the HEAD, staging area, and working tree when moving between commits and branches, including detached HEAD states and stash usage.
Learn how git stash records the working tree and staging area as a snapshot, updates them to head, and how apply and pop restore or remove stashes, preserving untracked files.
Explore the detached head state in git, learn how head points to a commit instead of a branch, and how to recover with a branch or reflog.
Learn how merging branches combines the commits and their snapshots by uniting the work each branch points to, using three-way merge or fast-forward strategies.
Explore how a three-way merge resolves changes from main and feature branches by comparing base commits, generating diffs, and creating a new commit with two parents.
Learn how a fast-forward merge updates the main branch when the feature branch already contains the latest changes, moving head forward to complete the merge.
Recap the differences between fast forwarding and the three-way merge, and explore their final results. Use the --no-ff option to force a merge commit in real-life branching.
Explore git workflow by switching between master and dev, creating feature branches, fixing production bugs, merging with fast-forward or three-way merges, and cherry-picking or rebasing.
Learn how cherry-picking selects individual commits from one branch and applies their diffs to main, creating a new commit with a fresh hash, and using dash M for multiple parents.
Compare rebasing and three-way merging, showing how rebasing moves a sequence of commits onto a base to create a linear, clean history, while a three-way merge preserves existing commits.
Learn how remote repositories back up work and enable collaboration, using clone to copy, push commits, and name the remote origin on hosts like GitHub or Bitbucket.
Learn that origin is just a default remote name and you can freely name additional remotes, clone from a main repo, and manage multiple remotes to merge and update projects.
Clone a GitHub repo to reveal local and remote branches, including origin/master and remote tracking branches. Learn to update these branches with git fetch and git push.
Learn how to fetch, push, and pull commits between local and remote repositories, manage remote tracking branches, and perform fast-forward or merge strategies with origin/master.
Map local branches to remote tracking branches by configuring upstreams and remotes, push to the correct remote and branch, and diagnose mapping and permission issues.
Compare git commit, git checkout, and git reset. Explain how head and branches move and differentiate soft, mixed, and hard resets with staging area and working tree implications.
Learn how to use git reset --soft to combine multiple commits into one, preserving the staging area and working tree while updating the commit history with a proper message.
Explore when to use git reset --mixed or --hard to fix a syntax error, update the staging area from a commit snapshot, and preserve the working file.
Learn how to undo staging by performing a mixed reset to the commit head points to, restore the staging area to a prior snapshot, and optionally unstage specific files.
Perform a hard reset to replace the staging area and working tree with the specified commit hash, discarding changes, then re-stage and re-commit, and clean up with garbage collection.
Explore how git checkout updates the staging area and working tree without erasing local changes. The lecture explains git reset --hard and git reset --merge as safer options.
Learn the golden rule of git: never rewrite history on a shared repository; reserve reset or rebase for private work, and learn how reverse differs from reset when undoing pushes.
Compare revert versus reset, and learn how to revert commits in git without changing history by applying diffs to create a new undo commit, preserving head, staging, and working tree.
Explore how conflicts arise when the same part of a file changes differently during merging, and learn when to use git merge, git rebase, and git cherry-pick to integrate work.
The lecture walks through a git scenario with a feature branch and master, showing a three-way merge, common base, diffs, and how conflicts are resolved in the terminal.
Resolve merge conflicts by reading conflict markers, decide between master and feature changes (or combine them), then stage, commit, or abort the merge as needed.
Explore how git stash evaluates the staging area and working tree for conflicts, how aborting stash works, and how a hard reset clears changes while preserving the stash.
Reset to the previous commit to fix the missing line by updating the staging area and working tree, then commit; or use git commit --amend in one step.
Identify the mistake of staging 100 items instead of two, and learn to unstage the extras by using HEAD as the reference, then stage only the intended two before committing.
Recover commits made during a detached head by locating the commit hash with reflog and creating a branch to preserve them, preventing garbage collection from deleting the history.
Ensure a clean working tree and staging area. Create a new branch to isolate work, stash unsafe changes, and reset to the previous commit hash if needed.
Learn to revert pushed merges with git revert HEAD, creating a new commit to preserve others' work and cover fast-forward cases, plus always creating a merge commit via an option.
Identify the trap of reverting commits before merging and its impact on future merges. Learn to remember the reverted commit hash and use demerge thoughtfully to ensure changes carry over.
Are you working with Git regularly but still get uncomfortable and anxious when things get a little out of hand? We are going to visualize the fundamental concepts and tools so that we will have a clear image of what's going on behind the scenes and overcome our fear of Git once and for all.
The following questions will be thoroughly answered throughout the course:
What commits actually are?
What is the point of the staging area?
Why does it called "index" as well?
What is master?
What is origin?
What is the difference between remote and origin?
What is the difference between remote branches and remote-tracking branches?
What branches actually are?
When is it safe to delete a branch?
Does it happen to you, that you know you don't need a branch anymore but still hesitate to delete it?
What is HEAD?
What does detached HEAD mean and how to get rid of it?
What is the difference between untracked and tracked files?
What is the difference between tracked files themselves?
Have you heard of unmodified, modified and staged?
When you merge branches, why sometimes you end up with a new commit and sometimes not?
Which leads to fast-forwarding vs three-way merging
What is the difference between merge and rebase?
What is the difference between fetch and pull?
What is reset and what is the difference between soft, mixed, and hard reset (what actually happens behind the scene when we run these commands)?
What is revert?
What is the difference between revert and reset?
What is Git's garbage collector and how does it help us?
What is a conflict, when should I expect conflicts to happen and how to solve them?