1️⃣ What is Git?
A: Git is a distributed version control system to track changes in source code during development—it's local-first, so you work offline and sync later. Pro tip: Unlike SVN, it snapshots entire repos for faster history rewinds.
2️⃣ What is GitHub?
A: GitHub is a cloud-based platform that hosts Git repositories and supports collaboration, issue tracking, and CI/CD via Actions. Example: Use it for pull requests to review code before merging—essential for open-source contribs.
3️⃣ Git vs GitHub
⦁ Git: Version control tool (local) for branching and commits.
⦁ GitHub: Hosting service for Git repositories (cloud-based) with extras like wikis and forks. Key diff: Git's the engine; GitHub's the garage for team parking!
4️⃣ What is a Repository (Repo)?
A: A storage space where your project’s files and history are saved—local or remote. Start one with
git init for personal projects or clone from GitHub for teams.5️⃣ Common Git Commands:
⦁
git init → Initialize a repo⦁
git clone → Copy a repo⦁
git add → Stage changes⦁
git commit → Save changes⦁
git push → Upload to remote⦁
git pull → Fetch and merge from remote⦁
git status → Check current state⦁
git log → View commit history Bonus:
git branch for listing branches—practice on a sample repo to memorize.6️⃣ What is a Commit?
A: A snapshot of your changes. Each commit has a unique ID (hash) and message—use descriptive msgs like "Fix login bug" for clear history.
7️⃣ What is a Branch?
A: A separate line of development. The default branch is usually main or master—create feature branches with
git checkout -b new-feature to avoid messing up main.8️⃣ What is Merging?
A: Combining changes from one branch into another—use
git merge after switching to target branch. Handles conflicts by prompting edits.9️⃣ What is a Pull Request (PR)?
A: A GitHub feature to propose changes, request reviews, and merge code into the main branch—great for code quality checks and discussions.
🔟 What is Forking?
A: Creating a personal copy of someone else’s repo to make changes independently—then submit a PR back to original. Common in open-source like contributing to React.
1️⃣1️⃣ What is.gitignore?
A: A file that tells Git which files/folders to ignore (e.g., logs, temp files, env variables)—add node_modules/ or.env to keep secrets safe.
1️⃣2️⃣ What is Staging Area?
A: A space where changes are held before committing—
git add moves files there for selective commits, like prepping a snapshot.1️⃣3️⃣ Difference between Merge and Rebase
⦁ Merge: Keeps all history, creates a merge commit—preserves timeline but can clutter logs.
⦁ Rebase: Rewrites history, makes it linear—cleaner but riskier for shared branches; use
git rebase main on features.1️⃣4️⃣ What is Git Workflow?
A: A set of rules like Git Flow (with develop/release branches) or GitHub Flow (simple feature branches to main)—pick based on team size for efficient releases.
1️⃣5️⃣ How to Resolve Merge Conflicts?
A: Manually edit the conflicted files (look for <<<< markers), then
git add resolved ones and git commit—use tools like VS Code's merger for ease. Always communicate with team!💬 Tap ❤️ if you found this useful!