Understanding Git, GitHub, and GitLab for Beginners

Version control is at the heart of modern software and data science projects. Whether you’re a developer, data scientist, or researcher, knowing how to manage code versions, collaborate effectively, and maintain project history is essential.
This article explains Git, GitHub, and GitLab—three of the most important tools in version control and collaborative development.
🔹 What is Git?
Git is an open-source distributed version control system (VCS) created by Linus Torvalds in 2005 (the same person who created Linux).
It was designed to:
Track changes in code.
Allow multiple people to collaborate.
Support branching and merging effectively.
Be fast, scalable, and secure.
👉 Unlike older systems (e.g., CVS, SVN), Git is distributed—every user has a full copy of the repository, not just a snapshot.
🔹 Key Features of Git
Distributed System → Everyone has a full local copy of the project.
Branching & Merging → Create separate branches for features and merge later.
Lightweight & Fast → Handles large codebases efficiently.
Data Integrity → Uses SHA-1 hashing to ensure content authenticity.
Staging Area → You can prepare commits before finalizing them.
🔹 Getting Started with Git
1. Installing Git
Windows → Download from Git for Windows.
Linux (Debian/Ubuntu) →
sudo apt-get update sudo apt-get install git
macOS →
brew install git
2. Configuring Git
git config --global user.name "Your Name"
git config --global user.email "youremail@example.com"
3. Initializing a Repository
git init
Creates a new local repository.
4. Cloning a Repository
git clone https://github.com/username/repo.git
Copies a remote repo to your machine.
🔹 Basic Git Commands
Here are some commands every beginner should know:
# Check current repo status
git status
# Add files to staging
git add file1.txt
git add . # add all files
# Commit staged changes
git commit -m "Initial commit"
# Create new branch
git branch feature-1
# Switch branches
git checkout feature-1
# (or with modern Git)
git switch feature-1
# Merge branches
git checkout main
git merge feature-1
# Push changes to remote
git push origin main
# Pull changes from remote
git pull origin main
# View history
git log
🔹 The Git Ecosystem & Key Terms
To use Git effectively, you should know these terms:
Repository (Repo): A project folder with Git tracking enabled.
Working Directory: Your actual project files.
Staging Area (Index): Temporary area where changes are prepared before committing.
Commit: A snapshot of your project’s state at a given time.
Branch: A parallel version of the repo (useful for working on features independently).
Merge: Combine changes from one branch into another.
Remote Repository: A copy hosted online (GitHub/GitLab).
Fork: A personal copy of someone else’s repo (common in open source).
Pull Request (PR): A way to propose merging changes (on GitHub/GitLab).
👉 Think of Git as the engine, while platforms like GitHub and GitLab act as social, collaborative frontends.
🔹 GitHub: Social Coding Platform
GitHub is a cloud-based platform built on top of Git that enables collaboration, code sharing, and project management.
Features of GitHub:
Host and share repositories.
Pull Requests (PRs) → for code review & collaboration.
Issues & Discussions → track bugs, tasks, and ideas.
GitHub Actions → CI/CD pipelines.
GitHub Pages → host static websites.
Large open-source community.
Basic Terms in GitHub
Repository → Project folder online.
Fork → Copy someone else’s repo into your account.
Star → Like a “bookmark” for interesting projects.
Pull Request (PR) → Suggest changes to a repo.
Issues → For bug tracking & discussions.
👉 Example Workflow on GitHub:
Fork a repo.
Clone it locally.
Make changes.
Commit & push changes.
Open a Pull Request.
🔹 GitLab: Complete DevOps Platform
GitLab is similar to GitHub but with additional focus on CI/CD, DevOps, and project management. It’s both a cloud service and can be self-hosted, which makes it attractive for enterprises.
Key Features of GitLab:
Code Repository Hosting (like GitHub).
Built-in CI/CD pipelines (no external service needed).
Project Management tools → Kanban boards, milestones, issue tracking.
Security & Compliance → Code scanning, audit logs, vulnerability management.
Self-Hosting → Companies can deploy GitLab on their own servers.
GitHub vs GitLab (Quick Comparison)
Feature | GitHub | GitLab |
Focus | Collaboration, Open Source | DevOps, End-to-End lifecycle |
CI/CD | GitHub Actions (external setup) | Built-in CI/CD pipelines |
Hosting | Cloud only (GitHub Enterprise for private) | Cloud + Self-Hosted |
Popularity | Largest open-source community | Strong in enterprises & DevOps |
Project Management | Basic issue tracking | Full Agile boards, roadmaps |
🔹 Why Learn Git, GitHub, and GitLab?
Essential for collaboration in software and data science.
Helps maintain version control and avoid overwriting work.
GitHub → Great for open source contributions.
GitLab → Ideal for enterprise DevOps workflows.
Builds a professional portfolio (your GitHub/GitLab profile is like a resume for developers).
🔹 Wrapping Up
Git = version control system.
GitHub = cloud platform for collaborative coding.
GitLab = all-in-one DevOps platform with Git at its core.
👉 If you’re just starting out:
Practice basic Git commands locally.
Create a GitHub account and publish your first repo.
Explore GitLab if you’re interested in DevOps.
Mastering these tools is non-negotiable for anyone in data science, software development, or research today.
Subscribe to my newsletter
Read articles from Jidhun Puthuppattu directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
