// The world's most popular version control system.
GIT IS THE BACKBONE OF COLLABORATION.
Git tracks every change to your code, allowing you to revert mistakes, branch experiments, and collaborate with others seamlessly. It's the standard for version control in software development.
WHY GIT?
Git is distributed—every developer has a full copy of the repository. It works offline, handles large projects efficiently, and enables powerful branching strategies for teams of any size.
OWN YOUR HISTORY.
Every commit is a snapshot. Every branch is a parallel timeline. Git gives you complete control over your project's evolution—no lock-in, no data loss, just pure version control.
12 lessons. Complete Git control.
Understand version control and Git basics
BeginnerInitialize repos and make first commits
BeginnerAdd, commit, status, and log fundamentals
BeginnerWork with branches and merge changes
BeginnerConnect to GitHub, push and pull code
BeginnerRevert, reset, and fix mistakes safely
IntermediateTemporarily save work without committing
IntermediateMark versions and important milestones
IntermediateClean up history and integrate changes cleanly
IntermediateFork, pull requests, and team workflows.
IntermediateCherry-pick, bisect, and powerful features.
AdvancedCommit conventions, branching strategies, workflows.
AdvancedGit was created by Linus Torvalds in 2005 to manage the Linux kernel project. Today, it's used by millions of developers—from individual programmers to massive corporations.
Git's distributed nature means no single point of failure. You can work offline, create branches for experiments, merge when ready, and share your work with anyone through platforms like GitHub, GitLab, and Bitbucket.
Understanding Git is essential for modern development. It's not just about version control—it's about collaboration, code review, automation, and DevOps practices.
The future of collaboration is Git. Own it.
Git is a distributed version control system that tracks changes in your code. It was created by Linus Torvalds in 2005 and has become the standard for version control worldwide.
Git has three main states for your files:
1. Git was created by _____ in 2005.
Hint: Linux creator
2. Git is a _____ version control system.
Hint: Not centralized
3. Files marked for commit are in the _____ state.
Hint: Ready to commit
4. Use _____ to set your identity.
Hint: Configuration command
5. Committed files are stored in the _____.
Hint: Repository
6. The three states are modified, staged, and _____.
Hint: Final state
7. git --version shows the _____.
Hint: Release number
8. Git tracks _____ in your code.
Hint: What files contain
A Git repository is a directory that contains your project files and the entire history of changes. It's the core concept in Git.
Use git clone to get a copy of an existing repository.
When you initialize or clone a repository, Git creates a hidden .git directory. This contains all the metadata and object database for your project.
1. Use _____ to initialize a new repository.
Hint: Initialize command
2. Use git _____ to copy an existing repository.
Hint: Get a copy
3. The .git directory contains the _____.
Hint: Object storage
4. git status shows the current _____.
Hint: Branch and changes
5. A repository contains project _____ and history.
Hint: Your code
6. git clone creates a _____ directory.
Hint: From remote
7. No commits yet means the repository is _____.
Hint: No snapshots
8. Initializing creates a hidden ._____ directory.
Hint: Git folder
The basic Git workflow involves: modifying files, staging changes, and committing them.
Use git add to stage files for commit.
1. Use git _____ to stage files.
Hint: Prepare for commit
2. Use git _____ to save changes.
Hint: Snapshot state
3. git log shows _____.
Hint: Past commits
4. git diff shows _____.
Hint: What changed
5. git add . stages _____ files.
Hint: Every file
6. A commit message uses the _____ flag.
Hint: Message flag
7. git diff --staged shows _____ changes.
Hint: Ready to commit
8. Each commit has a unique _____.
Hint: Commit ID
A branch is a parallel version of your repository. It allows you to work on features without affecting the main codebase.
1. Use git _____ to create a branch.
Hint: Create command
2. Use git _____ to switch branches.
Hint: Switch command
3. git checkout -b creates and _____.
Hint: Both actions
4. Use git _____ to combine branches.
Hint: Join together
5. git branch -d _____ a branch.
Hint: Removes
6. * in git branch output shows _____.
Hint: Active branch
7. Branches allow _____ development.
Hint: Simultaneous
8. git push origin --delete removes _____ branch.
Hint: On server
Remotes are versions of your repository hosted on the internet or network. They allow collaboration with others.
Fetch downloads changes from remote without merging them.
Push uploads your commits to the remote repository.
Pull fetches and merges changes in one command.
1. Use git _____ to view remotes.
Hint: Remote command
2. origin is the default _____ name.
Hint: Primary remote
3. git _____ downloads without merging.
Hint: Get changes
4. git _____ uploads commits.
Hint: Send to remote
5. git _____ fetches and merges.
Hint: Get and combine
6. git remote add _____ creates a remote.
Hint: Label for URL
7. git push -u sets the _____ branch.
Hint: Default tracking
8. git fetch updates _____ commits.
Hint: Not working files
Use git reset to unstage files.
Change the last commit (before pushing!).
Create a new commit that undoes previous changes.
1. git _____ unstages files.
Hint: Remove from staging
2. git checkout -- file _____ changes.
Hint: Throws away
3. git commit --_____ modifies the last commit.
Hint: Fix mistakes
4. git _____ creates a new undo commit.
Hint: Safe undo
5. git reset --_____ is dangerous.
Hint: Loses all data
6. Use git _____ to restore files.
Hint: New command
7. --soft keeps changes _____.
Hint: In staging area
8. Never amend commits that have been _____.
Hint: Shared with others
Stashing saves your uncommitted changes temporarily, so you can switch branches or pull updates.
1. git _____ saves changes temporarily.
Hint: Save for later
2. git stash _____ applies and removes.
Hint: Apply and delete
3. git stash _____ applies without removing.
Hint: Keep stash
4. git stash list shows all _____.
Hint: Saved changes
5. git stash _____ removes all stashes.
Hint: Delete everything
6. Use stash when you need to _____ branches.
Hint: Change branches
7. git stash -m adds a _____.
Hint: Description
8. stash@{0} is the _____ stash.
Hint: Most recent
Tags mark specific points in Git history, commonly used for releases (v1.0, v2.0, etc.).
1. Tags mark specific _____ in history.
Hint: Versions
2. git tag -a creates an _____ tag.
Hint: With message
3. git tag without flags creates _____ tag.
Hint: Simple
4. Use -m for the tag _____.
Hint: Description
5. git push origin _____ pushes a tag.
Hint: Specific tag
6. git push origin --_____ pushes all tags.
Hint: All at once
7. git tag -d deletes _____ tag.
Hint: On your machine
8. Tags are commonly used for _____.
Hint: Version marks
Rebasing moves or combines a sequence of commits to a new base commit. It creates a cleaner history.
Edit, squash, or reorder commits.
1. git _____ moves commits to new base.
Hint: Change base
2. Never rebase _____ commits.
Hint: Shared history
3. git rebase -i is _____ rebase.
Hint: With choices
4. squash combines commits with _____.
Hint: The one before
5. reword changes the _____ message.
Hint: Commit text
6. Rebase creates _____ history.
Hint: Straight line
7. drop in rebase means _____ commit.
Hint: Delete
8. Merge preserves exact _____..
Hint: All commits
Fork → Clone → Branch → Commit → Push → Pull Request
Click the "Fork" button on GitHub to create your own copy.
GitHub's "Sync fork" button updates your fork with one click.
1. A _____ creates your copy of a repo.
Hint: GitHub feature
2. git remote add _____ points to original.
Hint: Main repo
3. git fetch _____ gets latest changes.
Hint: From original
4. Pull requests are created on _____.
Hint: Web platform
5. Sync fork updates from _____ repository.
Hint: Main project
6. git clone creates a local _____.
Hint: On your machine
7. Fork workflow: Fork → Clone → Branch → _____ → Push → PR.
Hint: Save changes
8. PR stands for Pull _____.
Hint: Ask to merge
Apply specific commits from one branch to another.
Binary search to find the commit that introduced a bug.
Work on multiple branches simultaneously.
View all reference updates (your safety net!).
Remove untracked files.
1. git _____ applies specific commits.
Hint: Select commits
2. git _____ finds bug commits.
Hint: Binary search
3. git worktree allows _____ branches.
Hint: Simultaneous
4. git _____ is your safety net.
Hint: Reference log
5. git clean removes _____ files.
Hint: Not in Git
6. git bisect good/bad does binary _____.
Hint: Find bug
7. HEAD@{0} is the _____ position.
Hint: Latest
8. git clean -n does a _____.
Hint: Dry run
Exclude files from version control.
Create shortcuts for common commands.
1. Commit messages should use _____ mood.
Hint: Commands
2. First line of commit should be under _____ chars.
Hint: Short
3. node_modules should be in _____.
Hint: Excluded files
4. git config --global alias.st _____
Hint: Shortcut
5. Always _____ before starting work.
Hint: Get latest
6. Git Flow uses _____ branch for releases.
Hint: Production
7. Use branches for _____ development.
Hint: New functionality
8. Review changes before _____.
Hint: Uploading