Git has become synonymous with version control – it's the tool that tracks changes in your files
(especially source code) so you and others can collaborate without losing work. In this guide, we’ll level
up from the Git basics and explore intermediate concepts in a friendly, conversational way. We’ll briefly
revisit what Git is and how it came to be, then dive into key features like branching, merging vs.
rebasing, stashing changes, using logs and diffs to inspect history, and collaborating on platforms like
GitHub and GitLab. By the end, you’ll see why Git remains essential in modern development workflows
across software engineering, data science, and DevOps.


What is Git? (And a Quick History)

Git is a distributed version control system — in plain terms, it's a tool to track versions of files and code. Unlike older centralized systems, Git gives every developer a full copy of the repository history, enabling work offline and in parallel.

It was created in 2005 by Linus Torvalds, the same person behind the Linux kernel. Today, Git powers millions of projects and is the most widely used version control system in the world.

Branching and Merging: The Real Power of Git

One of Git’s best features is branching. A branch is like a parallel workspace where you can try out new features or fixes without messing up the main project. It’s fast, light, and perfect for experimenting.

git checkout -b feature/new-homepage

You can now make all your changes here, commit them, and once everything works, merge them back into main.

git checkout main
git merge feature/new-homepage

This creates a merge commit that brings the two histories together. It’s safe, keeps all your history, and is perfect when working with teams.

Rebase vs Merge — When to Use What

Rebasing rewrites your commit history so your changes appear as if they started from the latest main branch. This keeps history clean but should only be done on branches you haven’t pushed.

git checkout feature/new-homepage
git rebase main

Use merge when collaborating and you want to preserve all history.
Use rebase when cleaning up your own work before merging.

Git Stash — Pause Your Work Without Committing

git stash lets you save your changes temporarily so you can switch tasks without committing unfinished work.

git stash
# switch, do work...
git stash pop

Think of it like saving your progress and coming back later. You can even use git stash list to manage multiple stashes.

git log and git diff — Know Your History

  • git log --oneline --graph – View commit history visually
  • git diff – Show unstaged changes
  • git diff --staged – Show staged vs last commit
  • git diff branchA..branchB – Compare branches

These commands help track, inspect, and review project changes over time.

GitHub and GitLab: Taking Git to the Next Level

These platforms let you collaborate better with:

  • Issues to track bugs or ideas
  • Pull/Merge Requests for code reviews
  • CI/CD to automate testing and deployment

Common Workflows

1. Feature Branch Workflow

Create a branch, push code, open a pull request, review, and merge to main.

2. Forking Workflow

Ideal for open-source. Fork → Branch → PR to original repo.

3. Git Flow

Structured branching: develop, release, hotfix, and main. Best for teams with clear release cycles.

Visuals You Can Add

  • Branching flow with merge commit
  • Pull Request lifecycle
  • Git stash process comic-style

Why Git Still Rules

Git is more than just a command-line tool — it’s a workflow enabler. It helps you experiment freely, collaborate better, and manage change with confidence.

Final Thoughts

Git grows with you. As you become more confident, it becomes second nature. Combine it with GitHub or GitLab and you unlock a full toolkit for team-based software development.

Keep committing, keep experimenting, and build boldly.