Lesson 8.2: Introduction to Version Control (Git & GitHub Basics)
In this lesson, students will learn how to manage and track changes in their code using Git and GitHub. Version control is essential for collaboration, backup, and project management.
1. What is Version Control?
-
Version control allows you to track changes in your code over time.
-
Helps revert to previous versions if something breaks.
-
Essential for collaboration in teams.
2. Introduction to Git
-
Git is a distributed version control system.
-
Key Git concepts:
-
Repository (Repo): A project folder tracked by Git.
-
Commit: Save a snapshot of your code.
-
Branch: Work on features separately without affecting main code.
-
Merge: Combine branches into one.
-
Basic Git Commands:
3. Introduction to GitHub
-
GitHub is an online platform to host Git repositories.
-
Allows collaboration, sharing projects, and portfolio showcasing.
-
Create a GitHub account and push local repository to GitHub.
Basic Workflow:
4. Working with GitHub
-
Create a new repository on GitHub.
-
Clone repository locally:
-
Make changes, commit, and push to GitHub.
-
Collaborate using branches and pull requests.
5. Best Practices
-
Write meaningful commit messages.
-
Commit frequently to track progress.
-
Use branches for new features or experiments.
-
Regularly push code to GitHub for backup.
✅ Summary:
-
Git helps track and manage code changes efficiently.
-
GitHub allows online repository hosting, collaboration, and project showcase.
-
Mastering Git & GitHub is essential for professional web development workflows.
