Introduction to Git & GitHub
Welcome to the Git & GitHub Tutorial Series by CodeHarborHub β your ultimate guide to mastering version control and collaboration. Whether youβre a beginner or a developer looking to refine your workflow, this guide will help you understand how Git and GitHub work and how to use them efficiently.
What is Version Control?β
Version Control is a system that tracks changes to your projectβs files over time.
It allows developers to:
- Save different versions of a project.
- Revert to previous states if needed.
- Collaborate with multiple people without conflicts.
- Keep track of who made what changes and when.
Imagine working on a big project with your team. Instead of sending updated files manually, Git handles all version tracking automatically β making teamwork seamless.
What is Git?β
Git is a distributed version control system (DVCS) created by Linus Torvalds (the creator of Linux) in 2005. It helps you track, manage, and synchronize code changes locally and remotely.
Key Features of Gitβ
- Version Tracking: Keeps a full history of your project.
- Branching & Merging: Safely experiment without affecting main code.
- Offline Work: All operations can be done locally.
- Distributed System: Every developer has a full copy of the repository.
What is GitHub?β
GitHub is a web-based platform that hosts your Git repositories online. It adds collaboration features like issues, pull requests, project boards, actions, and discussions β making it the worldβs largest community for developers and open-source projects.
- Git = Tool for version control
- GitHub = Platform to host and collaborate on Git repositories
Installing Gitβ
Before using Git, install it on your system.
Windowsβ
- Visit git-scm.com/downloads
- Download the Windows installer.
- Follow the setup wizard (keep default settings).
macOSβ
brew install git
Linux (Ubuntu/Debian)β
sudo apt install git
Once installed, verify:
git --version
First-Time Setupβ
Before committing code, configure your Git identity:
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
To check your setup:
git config --list
Youβre now ready to start using Git!
Git Workflow Overviewβ
Git follows a 3-stage workflow:
| Stage | Description |
|---|---|
| Working Directory | Where you make changes to files. |
| Staging Area | Where you prepare changes before saving them. |
| Repository | Where committed versions are stored permanently. |
Basic Flow:β
git add β git commit β git push
Git vs GitHub vs GitLab vs Bitbucketβ
| Tool | Type | Description |
|---|---|---|
| Git | Version Control Tool | Tracks code changes locally. |
| GitHub | Hosting Platform | Cloud service for Git repositories. |
| GitLab | Hosting + DevOps | Offers CI/CD pipelines & issue tracking. |
| Bitbucket | Hosting Platform | Git-based collaboration by Atlassian. |
Why Developers Use Git & GitHubβ
- Manage project versions effortlessly
- Collaborate with teams globally
- Securely backup and share code
- Learn from open-source projects
- Automate workflows with GitHub Actions
- Showcase your work with GitHub profile and portfolio
Coming Nextβ
Now that you know the basics, move on to the next part: π Git Basics β Create, Commit & Track Changes
Additional Resourcesβ
Summaryβ
| Concept | Description |
|---|---|
| Git | Tool for tracking code changes. |
| GitHub | Platform for hosting and collaboration. |
| Version Control | Tracks project evolution and team changes. |
| Setup Commands | Configure Git username and email. |
| Next Step | Learn Git Basics and start committing your code! |
π This tutorial is part of the CodeHarborHub Git & GitHub learning path β empowering developers to build, collaborate, and grow together.