<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aritra Chatterjee</title>
    <description>The latest articles on DEV Community by Aritra Chatterjee (@aritrachatterjee9957).</description>
    <link>https://dev.to/aritrachatterjee9957</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3841092%2Fca13588c-f7dc-444f-8724-cc105c62a4d0.jpg</url>
      <title>DEV Community: Aritra Chatterjee</title>
      <link>https://dev.to/aritrachatterjee9957</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aritrachatterjee9957"/>
    <language>en</language>
    <item>
      <title>Git &amp; GitHub 101: A Beginner's Guide to Version Control</title>
      <dc:creator>Aritra Chatterjee</dc:creator>
      <pubDate>Wed, 13 May 2026 12:18:52 +0000</pubDate>
      <link>https://dev.to/aritrachatterjee9957/git-github-101-a-beginners-guide-to-version-control-3mc3</link>
      <guid>https://dev.to/aritrachatterjee9957/git-github-101-a-beginners-guide-to-version-control-3mc3</guid>
      <description>&lt;p&gt;Your friend leans over and says, &lt;em&gt;"Just push it to GitHub."&lt;/em&gt; You smile. You nod. You have absolutely no idea what that means.&lt;/p&gt;

&lt;p&gt;By the end of this blog, you won't just understand what it means — you'll be able to say it yourself, and explain it to someone else. Let's start from the very beginning.&lt;/p&gt;




&lt;h2&gt;
  
  
  First Things First: What is a Version Control System?
&lt;/h2&gt;

&lt;p&gt;Before we talk about Git or GitHub, we need to understand the problem they solve.&lt;/p&gt;

&lt;p&gt;Imagine you're building a website. You make some changes, something breaks, and now you can't remember what your code looked like before. Sound familiar?&lt;/p&gt;

&lt;p&gt;A &lt;strong&gt;Version Control System (VCS)&lt;/strong&gt; is a tool that tracks and manages changes to your files over time. Think of it as a time machine for your code — one that remembers every version of your project, so you can always go back.&lt;/p&gt;

&lt;p&gt;With a VCS, you can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save different versions of your code&lt;/li&gt;
&lt;li&gt;Revert to a previous version if something breaks&lt;/li&gt;
&lt;li&gt;Collaborate with other developers without overwriting each other's work&lt;/li&gt;
&lt;li&gt;Track who changed what, and when&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Three Types of Version Control Systems
&lt;/h2&gt;

&lt;p&gt;Not all VCS tools work the same way. Here's how they've evolved:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;How It Works&lt;/th&gt;
&lt;th&gt;Examples&lt;/th&gt;
&lt;th&gt;Key Trade-off&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Local VCS&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Store versions only on your computer&lt;/td&gt;
&lt;td&gt;—&lt;/td&gt;
&lt;td&gt;Simple, but zero collaboration support&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Centralised VCS (CVCS)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;All versions live on one central server&lt;/td&gt;
&lt;td&gt;SVN, CVS&lt;/td&gt;
&lt;td&gt;Easy collaboration, but if the server goes down, everyone's stuck&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Distributed VCS (DVCS)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Every developer has a full copy of the project&lt;/td&gt;
&lt;td&gt;
&lt;strong&gt;Git&lt;/strong&gt;, Mercurial&lt;/td&gt;
&lt;td&gt;Fast, offline-friendly, and more secure — the modern standard&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Git is a &lt;strong&gt;distributed VCS&lt;/strong&gt;, which is exactly why it became the industry standard.&lt;/p&gt;




&lt;h2&gt;
  
  
  Meet Git
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Git is like Microsoft Word's Track Changes — but for your entire codebase, and about 100x more powerful."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Git&lt;/strong&gt; is a distributed version control system created by &lt;strong&gt;Linus Torvalds in 2005&lt;/strong&gt; (yes, the same person who built the Linux kernel). It runs locally on your computer and takes &lt;strong&gt;snapshots&lt;/strong&gt; of your project every time you save your progress.&lt;/p&gt;

&lt;p&gt;Here's what makes Git special:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fast&lt;/strong&gt; — most operations happen on your own machine, no internet needed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branching&lt;/strong&gt; — you can create separate "versions" of your project to experiment freely&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Backup built-in&lt;/strong&gt; — every copy of a Git project is a full backup&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free and open source&lt;/strong&gt; — used by millions of developers worldwide&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So when someone says &lt;em&gt;"commit your changes"&lt;/em&gt; — they mean Git just saved a snapshot of your code at that moment. Like a save point in a video game.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;Git Official Website&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Meet GitHub
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Git is the tool. GitHub is where you put your work so the world can see it."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;GitHub&lt;/strong&gt; is a cloud-based platform that hosts your Git repositories online. While Git works on your computer, GitHub lets you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Store your project in the cloud&lt;/li&gt;
&lt;li&gt;Collaborate with a team&lt;/li&gt;
&lt;li&gt;Review each other's code via &lt;strong&gt;Pull Requests&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Track bugs and features with &lt;strong&gt;Issues&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Connect to deployment pipelines with &lt;strong&gt;CI/CD integrations&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The simplest way to remember the difference:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;Git&lt;/th&gt;
&lt;th&gt;GitHub&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;What it is&lt;/td&gt;
&lt;td&gt;A version control tool&lt;/td&gt;
&lt;td&gt;A platform to host repositories&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Where it runs&lt;/td&gt;
&lt;td&gt;Your local computer&lt;/td&gt;
&lt;td&gt;Online (browser/app)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Works offline?&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;❌ Mostly no&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Made by&lt;/td&gt;
&lt;td&gt;Linus Torvalds&lt;/td&gt;
&lt;td&gt;GitHub Inc.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;So when someone says &lt;em&gt;"push it to GitHub”&lt;/em&gt; — they mean: upload your Git snapshots to the cloud so others can see and access them.&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub Official Website&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  The Core Concepts (With Real-World Analogies)
&lt;/h2&gt;

&lt;p&gt;This is the part most beginner guides skip. Let's make sure the key ideas actually stick.&lt;/p&gt;

&lt;h3&gt;
  
  
  📁 Repository (Repo)
&lt;/h3&gt;

&lt;p&gt;A repository is your project folder — but one that has a memory. It remembers every single change ever made to every file inside it.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"It's your project folder if your project folder kept a journal."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A repo can be &lt;strong&gt;local&lt;/strong&gt; (on your computer) or &lt;strong&gt;remote&lt;/strong&gt; (on GitHub).&lt;/p&gt;




&lt;h3&gt;
  
  
  📸 Commit
&lt;/h3&gt;

&lt;p&gt;A commit is a saved snapshot of your project at a specific moment in time.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Think of commits like save points in a video game. Git doesn't just save where you are — it remembers every save point you've ever made. Died at level 5? Roll back to level 3 and try again."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Every commit has a message describing what changed, like: &lt;code&gt;"Added login page"&lt;/code&gt; or &lt;code&gt;"Fixed the navbar bug"&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  🎭 Staging Area
&lt;/h3&gt;

&lt;p&gt;Before you commit, you first decide &lt;em&gt;what&lt;/em&gt; you want to include in the save.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Imagine packing for a trip. You don't throw everything straight into the suitcase. First, you lay things out on the bed and decide what makes the cut. The bed is your staging area. &lt;code&gt;git add&lt;/code&gt; is you deciding what goes in."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  🌿 Branch
&lt;/h3&gt;

&lt;p&gt;A branch is a parallel version of your project where you can experiment freely.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Branches are like a parallel universe for your code. The &lt;code&gt;main&lt;/code&gt; branch is your real, working world. You create a new branch to experiment — and whatever chaos happens there, stays there. It doesn't touch the main world until you decide to merge it back."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl9rxwtthydbxxfvv1nx6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl9rxwtthydbxxfvv1nx6.png" alt="Git branch flow" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Common example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;main&lt;/code&gt; → your stable, live code&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;feature-login&lt;/code&gt; → new login feature being built separately&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  The Basic Git Workflow
&lt;/h2&gt;

&lt;p&gt;Here's what a typical day with Git looks like. Let's walk through it step by step, so nothing feels like magic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovwt1iruqc706nwxqm4v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fovwt1iruqc706nwxqm4v.png" alt="basic git workflow" width="800" height="133"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 1: Write or edit your code
&lt;/h3&gt;

&lt;p&gt;Just work normally in your project folder. Nothing Git-specific yet.&lt;/p&gt;




&lt;h3&gt;
  
  
  Step 2: Stage your changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;The &lt;code&gt;.&lt;/code&gt; means "everything." You're telling Git: &lt;em&gt;"Hey, watch all these files — I'm about to save them."&lt;/em&gt; Nothing is saved yet. You're just raising your hand.&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Step 3: Commit your changes
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Added login page"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Now you're actually saving. The &lt;code&gt;-m&lt;/code&gt; flag lets you write a message — a note to your future self (or teammates) explaining what changed. Think of it like adding a caption to a photo: &lt;em&gt;"Here's the project on day 12, with the login page added."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h3&gt;
  
  
  Step 4: Push to GitHub
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Two things to know here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;origin&lt;/code&gt; — Git's nickname for your GitHub repository (the remote/online version of your project)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;main&lt;/code&gt; — the branch you're pushing to (the primary, stable version)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So this line says: &lt;em&gt;"Upload my saved changes to the main branch of my GitHub project."&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Common Git Commands Cheat Sheet
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;What It Does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git init&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Start a new Git repository in your folder&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git clone &amp;lt;URL&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Download a repository from GitHub&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git status&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;See what's changed and what's staged&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git add .&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stage all changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git commit -m "msg"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Save a snapshot with a description&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git push&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Upload your commits to GitHub&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Download the latest changes from GitHub&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git branch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;View or create branches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git checkout -b &amp;lt;name&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Create and switch to a new branch&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git merge &amp;lt;branch&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Merge a branch into your current one&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Pro tip:&lt;/strong&gt; Run &lt;code&gt;git status&lt;/code&gt; constantly. It tells you exactly what state your files are in — which are untracked (red), which are staged (green), and whether you're ahead of GitHub.&lt;/p&gt;




&lt;h2&gt;
  
  
  Working With Branches
&lt;/h2&gt;

&lt;p&gt;Creating a branch is one of the most powerful things you can do in Git. Here's how:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create a new branch&lt;/span&gt;
git branch feature-login

&lt;span class="c"&gt;# Switch to it&lt;/span&gt;
git checkout feature-login

&lt;span class="c"&gt;# Or do both in one command&lt;/span&gt;
git checkout &lt;span class="nt"&gt;-b&lt;/span&gt; feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once your feature is ready, you merge it back into &lt;code&gt;main&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git checkout main
git merge feature-login
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No chaos. No broken main code. Just clean, parallel development.&lt;/p&gt;




&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;So — next time someone says &lt;em&gt;"just push it to GitHub"&lt;/em&gt; — you've got them.&lt;/p&gt;

&lt;p&gt;You now know that Git is the tool that tracks your changes locally, and GitHub is the platform that hosts your work online. You know what a commit is (a save point), what a branch is (a parallel universe for your code), and what staging means (packing your suitcase before the trip).&lt;/p&gt;

&lt;p&gt;Git isn't just another tool you learn for fun. It's the tool every software team on the planet already uses. Mastering it doesn't just make you a better developer — it makes you a hireable one.&lt;/p&gt;

&lt;p&gt;Now go initialise a repo. You've earned it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>beginners</category>
      <category>git</category>
      <category>github</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
