<?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: Amaresh Pati</title>
    <description>The latest articles on DEV Community by Amaresh Pati (@amareshpati).</description>
    <link>https://dev.to/amareshpati</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%2F3755145%2F4471d618-c3bb-4a50-b89e-2f26ea310c67.jpeg</url>
      <title>DEV Community: Amaresh Pati</title>
      <link>https://dev.to/amareshpati</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amareshpati"/>
    <language>en</language>
    <item>
      <title># Git Adventures --- Part 2: When Git Starts Judging Your Decisions</title>
      <dc:creator>Amaresh Pati</dc:creator>
      <pubDate>Thu, 26 Mar 2026 12:32:17 +0000</pubDate>
      <link>https://dev.to/amareshpati/-git-adventures-part-2-when-git-starts-judging-your-decisions-1lno</link>
      <guid>https://dev.to/amareshpati/-git-adventures-part-2-when-git-starts-judging-your-decisions-1lno</guid>
      <description>&lt;p&gt;In Part 1, everything was clean. Repository created. Project initialized. Branches created. Team motivated.&lt;/p&gt;

&lt;p&gt;That illusion lasted exactly one day.&lt;/p&gt;

&lt;p&gt;Because on Day 2, the team learned an important truth: &lt;strong&gt;Writing code is easy. Understanding history is hard.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And Git remembers everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 1 --- The Calm Before the Debugging Storm
&lt;/h2&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%2Fwb8n8osxaefk6wsaibd8.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%2Fwb8n8osxaefk6wsaibd8.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Amaresh notices something feels wrong after pulling updates. A feature that worked yesterday is broken. When did this happen?&lt;/p&gt;

&lt;p&gt;He opens the timeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;--oneline&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a3f9c2b Add authentication flow
9d1a2e4 Fix validation issue
c81be77 Initial setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each commit shows a short hash (abbreviated commit ID) and message.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When you need the full commit ID:&lt;/strong&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 log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or to just grab HEAD's full ID:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a3f9c2b7d8e9f0a1b2c3d4e5f6g7h8i9
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pro tip:&lt;/strong&gt; Use &lt;code&gt;git log --oneline -n 20&lt;/code&gt; to see only the last 20 commits. Saves scrolling through months of history.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The gotcha:&lt;/strong&gt; &lt;code&gt;git log&lt;/code&gt; shows commits in reverse chronological order (newest first). If you're looking for &lt;em&gt;when&lt;/em&gt; something broke, scroll down, not up.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Commit IDs are your time machine.&lt;/strong&gt; They allow precise navigation through Git history—and they're immutable. The same commit ID always points to the exact same code, forever.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 2 --- Understanding What Actually Changed
&lt;/h2&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%2Fb83y3b6jfme6j5e2v0e2.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%2Fb83y3b6jfme6j5e2v0e2.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Amaresh needs to see &lt;em&gt;exactly&lt;/em&gt; what was changed. Not just which files, but which lines.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gh"&gt;diff --git a/auth.js b/auth.js
index 1a2b3c4..5d6e7f8 100644
&lt;/span&gt;&lt;span class="gd"&gt;--- a/auth.js
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/auth.js
&lt;/span&gt;&lt;span class="p"&gt;@@ -12,7 +12,7 @@&lt;/span&gt;
  function validateToken(token) {
&lt;span class="gd"&gt;-   if (token.length &amp;lt; 32) {
&lt;/span&gt;&lt;span class="gi"&gt;+   if (token.length &amp;lt; 16) {
&lt;/span&gt;      return false;
    }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git highlights &lt;strong&gt;removed lines&lt;/strong&gt; in red (with &lt;code&gt;-&lt;/code&gt;) and &lt;strong&gt;added lines&lt;/strong&gt; in green (with &lt;code&gt;+&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compare two branches:&lt;/strong&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 diff main feat/authentication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This shows all changes in &lt;code&gt;feat/authentication&lt;/code&gt; that aren't in &lt;code&gt;main&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compare two commits:&lt;/strong&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 diff a3f9c2b 9d1a2e4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;See only filenames (not the code):&lt;/strong&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 diff &lt;span class="nt"&gt;--name-only&lt;/span&gt; main feat/authentication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;See file statistics:&lt;/strong&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 diff &lt;span class="nt"&gt;--stat&lt;/span&gt; main feat/authentication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="p"&gt;auth.js     | 15 ++++++++++++---
utils.js    |  8 ++------
&lt;/span&gt; 2 files changed, 14 insertions(+), 9 deletions(-)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The gotcha:&lt;/strong&gt; &lt;code&gt;git diff&lt;/code&gt; with no arguments shows &lt;strong&gt;unstaged changes only&lt;/strong&gt;. If you've already run &lt;code&gt;git add&lt;/code&gt;, you won't see those changes. Use &lt;code&gt;git diff --staged&lt;/code&gt; to see staged changes.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 3 --- Inspecting a Single Decision
&lt;/h2&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%2F4ohplfhhdml9eoxzxpqc.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%2F4ohplfhhdml9eoxzxpqc.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Johnny broke something three commits ago. Now Amaresh needs to see exactly what that commit changed.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="p"&gt;commit a3f9c2b7d8e9f0a1b2c3d4e5f6g7h8i9
Author: Johnny &amp;lt;johnny@company.com&amp;gt;
Date:   Wed Mar 24 14:32:15 2026 +0530
&lt;/span&gt;&lt;span class="err"&gt;
&lt;/span&gt;    Add authentication flow
&lt;span class="err"&gt;
&lt;/span&gt;&lt;span class="gh"&gt;diff --git a/auth.js b/auth.js
&lt;/span&gt;&lt;span class="p"&gt;new file mode 100644
&lt;/span&gt;&lt;span class="gh"&gt;index 0000000..a1b2c3d
&lt;/span&gt;&lt;span class="gd"&gt;--- /dev/null
&lt;/span&gt;&lt;span class="gi"&gt;+++ b/auth.js
&lt;/span&gt;&lt;span class="p"&gt;@@ -0,0 +1,45 @@&lt;/span&gt;
&lt;span class="gi"&gt;+function authenticate(user, password) {
&lt;/span&gt;...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;git show&lt;/code&gt; displays:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Author&lt;/strong&gt; — who made the change&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Date&lt;/strong&gt; — when it was committed&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Message&lt;/strong&gt; — the commit description&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full diff&lt;/strong&gt; — every line added/removed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;See just the commit message:&lt;/strong&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 show a3f9c2b &lt;span class="nt"&gt;--format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;fuller
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Use with current HEAD:&lt;/strong&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 show HEAD
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;This is your bug detective tool.&lt;/strong&gt; When you find a broken line, you can track exactly when it was added and by whom.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The gotcha:&lt;/strong&gt; If a commit only renamed a file without changing it, &lt;code&gt;git show&lt;/code&gt; will say "similarity index 100%" but show no actual changes. The file content is identical.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 4 --- The Unexpected Urgent Task
&lt;/h2&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%2Fgp0bedmbyur7t5ktwsd0.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%2Fgp0bedmbyur7t5ktwsd0.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Danny has been working on a feature for hours. Code is half-written, tests are incomplete. Then a critical production bug appears, and he must switch branches immediately.&lt;/p&gt;

&lt;p&gt;He can't commit incomplete work (it breaks the build). He can't lose his changes. So he uses:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This saves all changes to a temporary location and resets the working directory to the last commit.&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 hotfix/critical-bug
&lt;span class="c"&gt;# Fix the bug, commit, merge back to main&lt;/span&gt;
git checkout feat/incomplete-feature
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now he gets his incomplete work back:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;But there's a problem:&lt;/strong&gt; He had created a new file (&lt;code&gt;utils.js&lt;/code&gt;) that hadn't been staged. After stashing and popping, the file is gone.&lt;/p&gt;

&lt;p&gt;That's because &lt;code&gt;git stash&lt;/code&gt; by default only saves &lt;strong&gt;tracked&lt;/strong&gt; files (files Git already knows about). New files are left behind.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The solution:&lt;/strong&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 stash &lt;span class="nt"&gt;-u&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-u&lt;/code&gt; (or &lt;code&gt;--include-untracked&lt;/code&gt;) flag tells Git to stash everything, including brand new files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Better yet, use this to be safe:&lt;/strong&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 stash &lt;span class="nt"&gt;-u&lt;/span&gt; &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"WIP: authentication feature with new utils"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;-m&lt;/code&gt; flag lets you label the stash so you remember what's in it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View all stashes:&lt;/strong&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 stash list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;stash@{0}: WIP: authentication feature with new utils
stash@{1}: WIP: fixing typo in validator
stash@{2}: On main: saving work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pop a specific stash:&lt;/strong&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 stash pop stash@&lt;span class="o"&gt;{&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Delete a stash without popping:&lt;/strong&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 stash drop stash@&lt;span class="o"&gt;{&lt;/span&gt;0&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Clear all stashes (⚠️ dangerous):&lt;/strong&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 stash clear
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The gotcha:&lt;/strong&gt; &lt;code&gt;git stash pop&lt;/code&gt; removes the stash after applying it. If the pop fails (merge conflict), the stash stays safe. But if it succeeds and you later realize you needed it, it's gone. Use &lt;code&gt;git stash apply&lt;/code&gt; instead if you want to keep the stash around.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 5 --- The First Real Merge Conflict
&lt;/h2&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%2Fep1dypi6z5hr20fi094z.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%2Fep1dypi6z5hr20fi094z.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Johnny finishes his service-layer feature. Ronaldo finishes his database optimization feature. Both edited the same file. Johnny tries to merge Ronaldo's branch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git merge feat/service-layer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git responds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Auto-merging api.js
CONFLICT (content): Merge conflict in api.js
Automatic merge failed; fix conflicts and then commit the result.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;He opens &lt;code&gt;api.js&lt;/code&gt; and sees:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;HEAD&lt;/span&gt;
  &lt;span class="c1"&gt;// Ronaldo's code (database optimization)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;=======&lt;/span&gt;
  &lt;span class="c1"&gt;// Johnny's code (service layer)&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;service&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Service&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;feat&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;layer&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The conflict markers show:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD&lt;/code&gt; — start of current branch (what you have now)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;=======&lt;/code&gt; — divider&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; feat/service-layer&lt;/code&gt; — end of incoming branch (what you're merging in)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Johnny must decide:&lt;/strong&gt; Keep Ronaldo's code? Keep his own? Use both?&lt;/p&gt;

&lt;p&gt;He decides to use his service layer but call the optimized query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;service&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Service&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Johnny's code&lt;/span&gt;
  &lt;span class="c1"&gt;// Ronaldo's optimization is now inside service.fetch()&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now resolve the conflict:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add api.js
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Merge feat/service-layer: resolve conflict in api.js"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Tools to help with conflicts:&lt;/strong&gt;&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;# See which files have conflicts&lt;/span&gt;
git diff &lt;span class="nt"&gt;--name-only&lt;/span&gt; &lt;span class="nt"&gt;--diff-filter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;U

&lt;span class="c"&gt;# Use a visual merge tool (if configured)&lt;/span&gt;
git mergetool
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Abort a merge if you're not ready:&lt;/strong&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 merge &lt;span class="nt"&gt;--abort&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The gotcha:&lt;/strong&gt; Merge conflicts are not errors—they're Git asking you to make a decision. A merge with zero conflicts often means someone's code got silently overwritten. Conflicts are actually good; they force you to think.&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 6 --- Fetch vs Pull vs Merge (The Confusion Explained)
&lt;/h2&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%2Femiorkgktx4aaltbo9z8.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%2Femiorkgktx4aaltbo9z8.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Many developers use these terms interchangeably. They're not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git fetch&lt;/code&gt;&lt;/strong&gt; — Downloads changes from remote, but doesn't integrate them:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This updates your local tracking branches (&lt;code&gt;origin/main&lt;/code&gt;, &lt;code&gt;origin/feat/something&lt;/code&gt;) but leaves your local &lt;code&gt;main&lt;/code&gt; branch untouched.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git merge&lt;/code&gt;&lt;/strong&gt; — Combines histories:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This integrates the remote changes into your current branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;/strong&gt; — Fetch + merge in one command:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Equivalent to:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Why does this matter?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;professional workflow&lt;/strong&gt; is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git fetch origin          &lt;span class="c"&gt;# Download changes&lt;/span&gt;
git log main origin/main  &lt;span class="c"&gt;# Inspect what changed&lt;/span&gt;
git merge origin/main     &lt;span class="c"&gt;# Merge when ready&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Why? Because &lt;code&gt;git pull&lt;/code&gt; can silently create merge commits you didn't expect. Fetching first lets you review changes before integrating them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Comparison table:&lt;/strong&gt;&lt;/p&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;Changes local branch?&lt;/th&gt;
&lt;th&gt;Creates merge commit?&lt;/th&gt;
&lt;th&gt;Safe to use blindly?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git fetch&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;git merge&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;✅ Maybe&lt;/td&gt;
&lt;td&gt;⚠️ Only if branches are synced&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;✅ Yes&lt;/td&gt;
&lt;td&gt;✅ Usually&lt;/td&gt;
&lt;td&gt;⚠️ Can surprise you&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;The gotcha:&lt;/strong&gt; &lt;code&gt;git pull&lt;/code&gt; can create a merge commit automatically. If you're trying to keep a clean history, this is annoying. Use &lt;code&gt;git pull --rebase&lt;/code&gt; to rebase instead of merge (we'll cover rebase in Part 3).&lt;/p&gt;




&lt;h2&gt;
  
  
  Chapter 7 --- Undoing Mistakes Properly
&lt;/h2&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%2Fbxkglkg3f2i8c50imc7c.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%2Fbxkglkg3f2i8c50imc7c.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Mistakes happen. Git gives you three different ways to undo, and they each do something different.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake Type 1: "I edited a file but haven't staged it"
&lt;/h3&gt;

&lt;p&gt;Amaresh edited &lt;code&gt;config.js&lt;/code&gt; but realizes it's wrong. He hasn't run &lt;code&gt;git add&lt;/code&gt; yet.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This overwrites &lt;code&gt;config.js&lt;/code&gt; with the version from the last commit. Changes are gone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Old syntax (still works):&lt;/strong&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 config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Mistake Type 2: "I staged changes I shouldn't have"
&lt;/h3&gt;

&lt;p&gt;Amaresh ran &lt;code&gt;git add .&lt;/code&gt; and included &lt;code&gt;config.js&lt;/code&gt; accidentally. He hasn't committed yet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git restore &lt;span class="nt"&gt;--staged&lt;/span&gt; config.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This unstages the file. The file still exists in your working directory with all changes intact—only the staging is removed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Undo all staged changes:&lt;/strong&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 restore &lt;span class="nt"&gt;--staged&lt;/span&gt; &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h3&gt;
  
  
  Mistake Type 3: "I committed something wrong but haven't pushed"
&lt;/h3&gt;

&lt;p&gt;Johnny committed buggy code. It's in his local history but not on GitHub yet.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reset HEAD~1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This moves the branch pointer back one commit. The buggy commit disappears from history. But the files are still in your working directory with changes intact.&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;# Edit the files, fix the bug&lt;/span&gt;
git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Fixed version of that commit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The variants:&lt;/strong&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 reset &lt;span class="nt"&gt;--soft&lt;/span&gt; HEAD~1   &lt;span class="c"&gt;# Undo commit, keep changes staged&lt;/span&gt;
git reset &lt;span class="nt"&gt;--mixed&lt;/span&gt; HEAD~1  &lt;span class="c"&gt;# Undo commit, keep changes unstaged (default)&lt;/span&gt;
git reset &lt;span class="nt"&gt;--hard&lt;/span&gt; HEAD~1   &lt;span class="c"&gt;# Undo commit, DISCARD all changes (⚠️ dangerous)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The gotcha:&lt;/strong&gt; &lt;code&gt;git reset --hard&lt;/code&gt; is permanent. Your code is deleted. If you haven't pushed, you can use &lt;code&gt;git reflog&lt;/code&gt; to recover, but it's nerve-wracking. Default to &lt;code&gt;--mixed&lt;/code&gt; or &lt;code&gt;--soft&lt;/code&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Mistake Type 4: "I committed bad code that's already pushed"
&lt;/h3&gt;

&lt;p&gt;Ronaldo pushed a commit that broke production. He can't just &lt;code&gt;git reset&lt;/code&gt; because others have already pulled his changes. Rewriting history would break their local repos.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;This creates a &lt;strong&gt;new commit&lt;/strong&gt; that undoes the changes from commit &lt;code&gt;a3f9c2b&lt;/code&gt;. Git history stays intact. Everyone can pull the revert safely.&lt;/p&gt;

&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[main 7f8e9d0] Revert "Add broken authentication"
 1 file changed, 2 deletions(-)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the repo is fixed, and history shows exactly what happened.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compare the three approaches:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Situation&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Creates new commit?&lt;/th&gt;
&lt;th&gt;Safe to push?&lt;/th&gt;
&lt;th&gt;Reversible?&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Unstaged file mess&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git restore&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;✅ N/A&lt;/td&gt;
&lt;td&gt;❌ Deleted&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Staged file mess&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git restore --staged&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;✅ N/A&lt;/td&gt;
&lt;td&gt;✅ Still in working dir&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Wrong local commit&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git reset&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;❌ No&lt;/td&gt;
&lt;td&gt;❌ Rewrites history&lt;/td&gt;
&lt;td&gt;✅ Use &lt;code&gt;git reflog&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pushed bad commit&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git revert&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;✅ Yes&lt;/td&gt;
&lt;td&gt;✅ Safe&lt;/td&gt;
&lt;td&gt;✅ Fully reversible&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  The Safety Net: &lt;code&gt;git reflog&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;Here's the command nobody tells you about until you need it.&lt;/p&gt;

&lt;p&gt;Amaresh ran &lt;code&gt;git reset --hard&lt;/code&gt; and deleted code he wanted. Is it gone forever?&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;a3f9c2b HEAD@{0}: reset: moving to HEAD~1
9d1a2e4 HEAD@{1}: commit: Add authentication flow
c81be77 HEAD@{2}: commit: Initial setup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The reflog shows every place HEAD has been. He can recover:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git reset &lt;span class="nt"&gt;--hard&lt;/span&gt; HEAD@&lt;span class="o"&gt;{&lt;/span&gt;1&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The safety net catches you.&lt;/strong&gt; Use this when you panic after a hard reset.&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Reference Cheat Sheet
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Problem&lt;/th&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;View commit history&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git log --oneline&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shows last commits&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;See what changed&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git diff&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shows unstaged changes&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;See staged changes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git diff --staged&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shows changes ready to commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Compare branches&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git diff main feat/new&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shows differences&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Inspect a commit&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git show &amp;lt;commit-id&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shows commit details&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Save work temporarily&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git stash -u -m "label"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Saves including untracked files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Restore saved work&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git stash pop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Applies last stash&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Download remote changes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git fetch origin&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Safe, doesn't merge&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Download + merge&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git pull&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Fetch + merge in one&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Undo unstaged changes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git restore &amp;lt;file&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Discards edits to file&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Unstage changes&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git restore --staged &amp;lt;file&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Keeps changes, removes from staging&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Undo last commit (local)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git reset HEAD~1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Moves branch back&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Undo last commit (pushed)&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git revert &amp;lt;commit-id&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates undo commit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Undo hard reset&lt;/td&gt;
&lt;td&gt;&lt;code&gt;git reflog&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shows all HEAD positions&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;p&gt;By the end of Day 2, the team realized something important:&lt;/p&gt;

&lt;p&gt;Git doesn't judge you for making mistakes. &lt;strong&gt;It judges you for not knowing how to recover from them.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Master these commands, and you'll never panic:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git log&lt;/code&gt; + &lt;code&gt;git show&lt;/code&gt; — understand what happened&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git diff&lt;/code&gt; — see exactly what changed&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git stash&lt;/code&gt; — escape from immediate problems&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git restore&lt;/code&gt; / &lt;code&gt;git reset&lt;/code&gt; / &lt;code&gt;git revert&lt;/code&gt; — fix them the right way&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git reflog&lt;/code&gt; — panic button&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  End of Part 2
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The team learned:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;git log --oneline&lt;/code&gt; — time machine for commits&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git diff&lt;/code&gt; — see changes precisely&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git show&lt;/code&gt; — inspect a single commit&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git stash -u&lt;/code&gt; — save incomplete work&lt;/li&gt;
&lt;li&gt;Merge conflicts — human decisions required&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git fetch&lt;/code&gt; vs &lt;code&gt;git pull&lt;/code&gt; — when to use which&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git restore&lt;/code&gt; vs &lt;code&gt;git reset&lt;/code&gt; vs &lt;code&gt;git revert&lt;/code&gt; — right tool for the job&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;git reflog&lt;/code&gt; — the safety net&lt;/li&gt;
&lt;/ul&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%2Fez324ex5hvcve0s79dub.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%2Fez324ex5hvcve0s79dub.png" alt=" " width="800" height="446"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Coming in Part 3
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Rebase&lt;/strong&gt; — rewriting history (safely)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive rebase&lt;/strong&gt; — rearranging commits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cherry-pick&lt;/strong&gt; — copying specific commits&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tagging&lt;/strong&gt; — marking important versions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rebasing vs Merging&lt;/strong&gt; — the great Git debate&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>devjournal</category>
      <category>git</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Git Adventures --- Part 1: Five Developers, One Repo, and the "It Works on My Machine" Era</title>
      <dc:creator>Amaresh Pati</dc:creator>
      <pubDate>Tue, 10 Mar 2026 04:50:00 +0000</pubDate>
      <link>https://dev.to/amareshpati/git-adventures-part-1-five-developers-one-repo-and-the-it-works-on-my-machine-era-118n</link>
      <guid>https://dev.to/amareshpati/git-adventures-part-1-five-developers-one-repo-and-the-it-works-on-my-machine-era-118n</guid>
      <description>&lt;p&gt;Every software project begins the same way.&lt;/p&gt;

&lt;p&gt;Someone says &lt;strong&gt;"Let's build something amazing."&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Ten minutes later someone asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Wait... who created the Git repo?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This is the story of a five-person development team starting their first&lt;br&gt;
project together.&lt;/p&gt;

&lt;p&gt;Meet the team.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Virat --- The Repo Master&lt;/strong&gt;&lt;br&gt;
Responsible for repositories and access control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amaresh --- The Architect&lt;/strong&gt;&lt;br&gt;
Designs the project structure and keeps the codebase organized.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Johnny, Danny, Ronaldo --- The Feature Crew&lt;/strong&gt;&lt;br&gt;
Three developers who will build features, write code, and occasionally&lt;br&gt;
break things.&lt;/p&gt;

&lt;p&gt;Today is &lt;strong&gt;Day 1&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And the project begins with the most important step in any software&lt;br&gt;
project.&lt;/p&gt;

&lt;p&gt;Creating the repository.&lt;/p&gt;


&lt;h1&gt;
  
  
  Chapter 1 --- The Repo Is Born
&lt;/h1&gt;

&lt;p&gt;Virat opens his terminal and announces that the project officially&lt;br&gt;
begins.&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="nb"&gt;mkdir &lt;/span&gt;project-hyperdrive
&lt;span class="nb"&gt;cd &lt;/span&gt;project-hyperdrive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now he initializes Git.&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;



&lt;p&gt;Git responds:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Initialized empty Git repository
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Behind the scenes something important just happened.&lt;/p&gt;

&lt;p&gt;Git created a hidden folder called:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This folder stores everything Git needs:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  commit history&lt;/li&gt;
&lt;li&gt;  branches&lt;/li&gt;
&lt;li&gt;  logs&lt;/li&gt;
&lt;li&gt;  references&lt;/li&gt;
&lt;li&gt;  repository metadata&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Without &lt;code&gt;.git&lt;/code&gt;, the folder is just a normal directory.&lt;/p&gt;

&lt;p&gt;With &lt;code&gt;.git&lt;/code&gt;, it becomes a &lt;strong&gt;version-controlled project&lt;/strong&gt;.&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%2Fvjd7y1rskydsvgc134ry.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%2Fvjd7y1rskydsvgc134ry.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Chapter 2 --- The Architect Builds the Foundation
&lt;/h1&gt;

&lt;p&gt;Virat turns to Amaresh.&lt;/p&gt;

&lt;p&gt;The repository exists now, but a repository without files is like a city&lt;br&gt;
without buildings.&lt;/p&gt;

&lt;p&gt;Amaresh prepares the &lt;strong&gt;initial project structure&lt;/strong&gt; on his machine.&lt;/p&gt;

&lt;p&gt;He checks what Git sees.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Untracked files:
README.md
src/
config/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Git sees the files but does not track them automatically.&lt;/p&gt;

&lt;p&gt;Developers must tell Git which files should be tracked.&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%2Fmfk42n367eukvf03frfs.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%2Fmfk42n367eukvf03frfs.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Chapter 3 --- Connecting the Two Worlds
&lt;/h1&gt;

&lt;p&gt;Virat created the repository on &lt;strong&gt;his machine&lt;/strong&gt;, and Amaresh prepared&lt;br&gt;
the project on &lt;strong&gt;his laptop&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Johnny asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How are we working in the same repository?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Virat explains.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Local Repository → developer machines
Remote Repository → shared server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Virat connects his repository to the remote server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin https://company-repo/project.git
git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Amaresh connects his machine to the same repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add origin https://company-repo/project.git
git pull origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now both machines share the &lt;strong&gt;same Git history&lt;/strong&gt;.&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%2Fmup6olv2fyo8j4he5nrj.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%2Fmup6olv2fyo8j4he5nrj.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Chapter 4 --- Teaching Git What to Remember
&lt;/h1&gt;

&lt;p&gt;Amaresh stages the project files.&lt;br&gt;
&lt;/p&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;p&gt;The dot (&lt;code&gt;.&lt;/code&gt;) means &lt;strong&gt;add everything inside the current directory&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Git workflow:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Working Directory → Staging Area → Commit History
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Staging allows developers to choose which files should go into the next&lt;br&gt;
commit.&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%2Fp23h1dk2us0yw9rin1wt.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%2Fp23h1dk2us0yw9rin1wt.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;h1&gt;
  
  
  Chapter 5 --- The First Commit
&lt;/h1&gt;

&lt;p&gt;Amaresh creates the first commit.&lt;br&gt;
&lt;/p&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;"Initial project setup"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A commit is a &lt;strong&gt;snapshot of the project at a specific moment&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Each commit records:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  changes&lt;/li&gt;
&lt;li&gt;  author&lt;/li&gt;
&lt;li&gt;  time&lt;/li&gt;
&lt;li&gt;  commit message&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Chapter 6 --- Sharing the Repo With the Team
&lt;/h1&gt;

&lt;p&gt;Virat grants repository access to the team.&lt;/p&gt;

&lt;p&gt;Johnny clones the repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://company-repo/project.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Danny checks the status.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Output:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;On branch main
Your branch is up to date with origin/main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Everyone is synchronized.&lt;/p&gt;




&lt;h1&gt;
  
  
  Chapter 7 --- The Branching Rules
&lt;/h1&gt;

&lt;p&gt;The &lt;code&gt;main&lt;/code&gt; branch must always remain stable.&lt;/p&gt;

&lt;p&gt;Developers create branches for their work.&lt;/p&gt;

&lt;h3&gt;
  
  
  Feature
&lt;/h3&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;feat/login-system
feat/payment-module
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Bugfix
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bugfix/login-validation
bugfix/crash-on-start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Hotfix
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hotfix/security-patch
hotfix/payment-crash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Chore
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chore/update-dependencies
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Docs
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docs/setup-guide
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Refactor
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;refactor/auth-module
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Style
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;style/code-formatting
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Test
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;test/auth-tests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Performance
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;perf/query-optimization
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Release
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;release/v1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Workflow:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Create branch → Commit → Push → Pull Request → Review → Merge
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fx2nfv9xnf6uijgzl5bsj.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%2Fx2nfv9xnf6uijgzl5bsj.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  Chapter 8 --- The Feature Crew Begins
&lt;/h1&gt;

&lt;p&gt;Amaresh assigns tasks.&lt;/p&gt;

&lt;p&gt;Johnny:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b feat/authentication
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Danny:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b feat/profile-system
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Ronaldo:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git checkout -b feat/service-integration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Three developers.&lt;/p&gt;

&lt;p&gt;Three branches.&lt;/p&gt;

&lt;p&gt;One repository.&lt;/p&gt;

&lt;p&gt;And somewhere in the future...&lt;/p&gt;

&lt;p&gt;A merge conflict is waiting.&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%2Fvy45khp7yiae6h7l81j6.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%2Fvy45khp7yiae6h7l81j6.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h1&gt;
  
  
  End of Part 1
&lt;/h1&gt;

&lt;p&gt;What the team learned:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  git init&lt;/li&gt;
&lt;li&gt;  git status&lt;/li&gt;
&lt;li&gt;  git add&lt;/li&gt;
&lt;li&gt;  git commit&lt;/li&gt;
&lt;li&gt;  git remote&lt;/li&gt;
&lt;li&gt;  git push&lt;/li&gt;
&lt;li&gt;  git clone&lt;/li&gt;
&lt;li&gt;  git branch&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Branch naming examples:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;feat/
bugfix/
hotfix/
docs/
chore/
refactor/
style/
test/
perf/
release/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;




&lt;h1&gt;
  
  
  What Happens in Part 2
&lt;/h1&gt;

&lt;p&gt;In the next part the team will learn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  PR creation&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;git log&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;git diff&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;git show&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;git stash&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;  resolving merge conflicts&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Follow the series for &lt;strong&gt;Part 2&lt;/strong&gt;.&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%2Fjmt1oy87wnh4brpl9pp1.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%2Fjmt1oy87wnh4brpl9pp1.png" alt=" " width="800" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>git</category>
      <category>github</category>
      <category>programming</category>
    </item>
    <item>
      <title>Tools AI Can’t Replace (And I use almost daily)</title>
      <dc:creator>Amaresh Pati</dc:creator>
      <pubDate>Tue, 17 Feb 2026 04:50:00 +0000</pubDate>
      <link>https://dev.to/amareshpati/tools-ai-cant-replace-and-i-use-almost-daily-28kh</link>
      <guid>https://dev.to/amareshpati/tools-ai-cant-replace-and-i-use-almost-daily-28kh</guid>
      <description>&lt;p&gt;As developers, we keep discovering tools that quietly make our lives easier.&lt;br&gt;&lt;br&gt;
Not flashy. Not hyped. Just… effective.&lt;/p&gt;

&lt;p&gt;These are three tools I keep coming back to because they &lt;strong&gt;remove friction from my workflow&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
They save time, reduce mental load, and let me focus on building features instead of fighting setup, data, or formats.&lt;/p&gt;




&lt;h2&gt;
  
  
  DummyJSON — An Instant Backend for Frontend Work
&lt;/h2&gt;

&lt;p&gt;🔗 &lt;a href="https://dummyjson.com" rel="noopener noreferrer"&gt;https://dummyjson.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When I start working on a new feature, backend readiness is often the bottleneck.&lt;br&gt;&lt;br&gt;
DummyJSON removes that problem entirely.&lt;/p&gt;

&lt;p&gt;It gives you ready-to-use REST APIs with realistic data — users, products, posts, todos, comments, and more — without any setup.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why it’s genuinely useful
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create &lt;strong&gt;custom APIs&lt;/strong&gt; using your own JSON
&lt;/li&gt;
&lt;li&gt;Ready endpoints like &lt;code&gt;/products&lt;/code&gt;, &lt;code&gt;/users&lt;/code&gt;, &lt;code&gt;/todos&lt;/code&gt;, &lt;code&gt;/posts&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Full HTTP support: &lt;code&gt;GET&lt;/code&gt;, &lt;code&gt;POST&lt;/code&gt;, &lt;code&gt;PUT&lt;/code&gt;, &lt;code&gt;PATCH&lt;/code&gt;, &lt;code&gt;DELETE&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Pagination, search, and filtering built in
&lt;/li&gt;
&lt;li&gt;Zero setup. Zero configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How it helps me
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;I build UI and business logic without waiting on backend completion
&lt;/li&gt;
&lt;li&gt;I can test real-world scenarios like loading states and empty responses
&lt;/li&gt;
&lt;li&gt;No need to maintain mock servers or fake data generators
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of guessing how data &lt;em&gt;might&lt;/em&gt; look, I work with something close to production from day one.&lt;/p&gt;




&lt;h2&gt;
  
  
  📨 DummyInbox — Clean Email Testing Without Noise
&lt;/h2&gt;

&lt;p&gt;🔗 &lt;a href="https://dummyinbox.com" rel="noopener noreferrer"&gt;https://dummyinbox.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Testing email-based flows using your real inbox gets messy fast.&lt;br&gt;&lt;br&gt;
DummyInbox fixes this with the simplest possible approach.&lt;/p&gt;

&lt;p&gt;You get disposable email addresses instantly — no signup, no login, no tracking.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why I keep using it
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Instant temporary email addresses
&lt;/li&gt;
&lt;li&gt;Auto-expiring inboxes
&lt;/li&gt;
&lt;li&gt;No spam in personal or work email
&lt;/li&gt;
&lt;li&gt;Unlimited usage, completely free
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Where it fits in my workflow
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Testing signup and onboarding flows
&lt;/li&gt;
&lt;li&gt;Verifying OTPs and confirmation emails
&lt;/li&gt;
&lt;li&gt;QA testing notification and alert emails
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It does one job — and does it really well.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 JSON Crack — Making Sense of Messy JSON
&lt;/h2&gt;

&lt;p&gt;🔗 &lt;a href="https://jsoncrack.com/editor" rel="noopener noreferrer"&gt;https://jsoncrack.com/editor&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you work with APIs, you &lt;em&gt;will&lt;/em&gt; deal with large, deeply nested JSON responses.&lt;br&gt;&lt;br&gt;
JSON Crack turns that chaos into clarity.&lt;/p&gt;

&lt;p&gt;Paste your JSON and instantly get a visual tree or graph of the structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Features that actually matter
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Interactive visualization of JSON structures
&lt;/li&gt;
&lt;li&gt;Supports JSON, YAML, CSV, XML, TOML
&lt;/li&gt;
&lt;li&gt;Built-in formatter and validator
&lt;/li&gt;
&lt;li&gt;Easy format conversion
&lt;/li&gt;
&lt;li&gt;Export visuals for documentation or sharing
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  How I use it in real life
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Understand complex API responses copied from Postman
&lt;/li&gt;
&lt;li&gt;Debug unexpected nested fields quickly
&lt;/li&gt;
&lt;li&gt;Explain payload structures to teammates without long explanations
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Scrolling raw JSON is painful.&lt;br&gt;&lt;br&gt;
Visualizing it saves time and mental energy.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Why These Tools Stick With Me
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Problem Solved&lt;/th&gt;
&lt;th&gt;Real Impact&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;DummyJSON&lt;/td&gt;
&lt;td&gt;Backend dependency&lt;/td&gt;
&lt;td&gt;Faster frontend development&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DummyInbox&lt;/td&gt;
&lt;td&gt;Email testing clutter&lt;/td&gt;
&lt;td&gt;Clean QA, zero inbox pollution&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JSON Crack&lt;/td&gt;
&lt;td&gt;JSON complexity&lt;/td&gt;
&lt;td&gt;Faster debugging &amp;amp; understanding&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;They don’t replace thinking.&lt;br&gt;&lt;br&gt;
They &lt;strong&gt;remove unnecessary effort&lt;/strong&gt; — and that’s exactly what good tools should do.&lt;/p&gt;




&lt;h2&gt;
  
  
  👏 Shoutout Where It’s Due
&lt;/h2&gt;

&lt;p&gt;A big shoutout to &lt;strong&gt;Ovi&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
👉 &lt;a href="https://github.com/Ovi" rel="noopener noreferrer"&gt;https://github.com/Ovi&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For building and maintaining &lt;strong&gt;DummyJSON&lt;/strong&gt; and &lt;strong&gt;DummyInbox&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;These tools are a great example of developer-first thinking:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;simple
&lt;/li&gt;
&lt;li&gt;reliable
&lt;/li&gt;
&lt;li&gt;and focused on real problems we face every day
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Open-source tools like these quietly power a lot of our workflows — and they deserve more appreciation.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Note
&lt;/h2&gt;

&lt;p&gt;I’ve tried many productivity tools.&lt;br&gt;&lt;br&gt;
Most don’t survive daily usage.&lt;/p&gt;

&lt;p&gt;These three did — because they solve real problems I face while building products.&lt;br&gt;&lt;br&gt;
No hype. Just utility.&lt;/p&gt;

&lt;p&gt;If you’re a frontend, mobile, or full-stack developer, chances are these tools will quietly improve your workflow too.&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>fullstack</category>
      <category>productivity</category>
      <category>developer</category>
    </item>
    <item>
      <title>[Boost]</title>
      <dc:creator>Amaresh Pati</dc:creator>
      <pubDate>Sat, 07 Feb 2026 06:15:30 +0000</pubDate>
      <link>https://dev.to/amareshpati/-481d</link>
      <guid>https://dev.to/amareshpati/-481d</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/amareshpati" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&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%2Fuser%2Fprofile_image%2F3755145%2F4471d618-c3bb-4a50-b89e-2f26ea310c67.jpeg" alt="amareshpati"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/amareshpati/why-i-started-wrapping-everything-in-react-native-a9c" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Why I Started Wrapping Everything in React Native?&lt;/h2&gt;
      &lt;h3&gt;Amaresh Pati ・ Feb 6&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
        &lt;span class="ltag__link__tag"&gt;#reactnative&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#programming&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#jsx&lt;/span&gt;
        &lt;span class="ltag__link__tag"&gt;#javascript&lt;/span&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
      <category>reactnative</category>
      <category>programming</category>
      <category>jsx</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Why I Started Wrapping Everything in React Native?</title>
      <dc:creator>Amaresh Pati</dc:creator>
      <pubDate>Fri, 06 Feb 2026 04:10:33 +0000</pubDate>
      <link>https://dev.to/amareshpati/why-i-started-wrapping-everything-in-react-native-a9c</link>
      <guid>https://dev.to/amareshpati/why-i-started-wrapping-everything-in-react-native-a9c</guid>
      <description>&lt;p&gt;🚀I’ve been working with React Native for about 4 years now, and one thing I’ve learned the hard way is this:&lt;br&gt;
Nothing stays permanent.&lt;/p&gt;

&lt;p&gt;Libraries get deprecated.&lt;br&gt;
Best practices change.&lt;br&gt;
Things that were “recommended” last year suddenly feel wrong today.&lt;/p&gt;

&lt;p&gt;At some point, I started asking myself:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Why am I fixing the same problem again and again, just because a library changed?&lt;/strong&gt;🤔&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  The Pattern I Kept Seeing
&lt;/h2&gt;

&lt;p&gt;Let’s be honest — React Native apps don’t die quickly.&lt;br&gt;
They live for years.&lt;/p&gt;

&lt;p&gt;But during that time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FlatList starts struggling with performance&lt;/li&gt;
&lt;li&gt;FlashList shows up and becomes the new standard&lt;/li&gt;
&lt;li&gt;SafeAreaView from react-native is no longer enough&lt;/li&gt;
&lt;li&gt;We move to react-native-safe-area-context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And suddenly you’re touching &lt;strong&gt;dozens of files&lt;/strong&gt; for what is essentially one &lt;strong&gt;decision change&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That’s when I realised —&lt;br&gt;
&lt;strong&gt;The mistake was never the library choice; it was how tightly my app depended on it&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  The Simple Rule I Follow Now
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Never use core or third-party components directly across the app.&lt;/li&gt;
&lt;li&gt;Wrap them once. Own them.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;I started creating a &lt;strong&gt;top layer of base components&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 1:&lt;/strong&gt; Lists (FlatList → FlashList)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I stopped doing&lt;/strong&gt;&lt;br&gt;
Using FlatList directly everywhere:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { FlatList } from 'react-native';

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because I already know how this story ends.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What I do instead:&lt;/strong&gt; AppFlatList&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// AppFlatList.tsx
import React from 'react';
import { FlatList, FlatListProps } from 'react-native';

export function AppFlatList&amp;lt;T&amp;gt;(props: FlatListProps&amp;lt;T&amp;gt;) {
  return (
    &amp;lt;FlatList
      {...props}
      removeClippedSubviews
      windowSize={5}
      initialNumToRender={10}
    /&amp;gt;
  );
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage stays simple:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;AppFlatList
  data={data}
  renderItem={renderItem}
  keyExtractor={(item) =&amp;gt; item.id}
/&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when performance becomes an issue (and it will), I don’t panic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Later… switching to FlashList&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// AppFlatList.tsx
import { FlashList, FlashListProps } from '@shopify/flash-list';

export function AppFlatList&amp;lt;T&amp;gt;(props: FlashListProps&amp;lt;T&amp;gt;) {
  return &amp;lt;FlashList {...props} estimatedItemSize={60} /&amp;gt;;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it.&lt;/p&gt;

&lt;p&gt;No screen changes.&lt;br&gt;
No refactor weekends.&lt;br&gt;
No stress.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example 2:&lt;/strong&gt; Base Component Deprecation (SafeAreaView)&lt;br&gt;
This one hit me multiple times.&lt;/p&gt;

&lt;p&gt;Earlier we all used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { SafeAreaView } from 'react-native';

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Later, we were told:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“Use react-native-safe-area-context instead.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now imagine SafeAreaView used everywhere.&lt;/p&gt;

&lt;p&gt;Painful, right?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// AppSafeAreaView.tsx
import React from 'react';
import { SafeAreaView } from 'react-native-safe-area-context';

export function AppSafeAreaView({ children, style }) {
  return (
    &amp;lt;SafeAreaView style={[{ flex: 1 }, style]}&amp;gt;
      {children}
    &amp;lt;/SafeAreaView&amp;gt;
  );
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Usage:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;AppSafeAreaView&amp;gt;
  &amp;lt;HomeScreen /&amp;gt;
&amp;lt;/AppSafeAreaView&amp;gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I don’t care:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if API changes&lt;/li&gt;
&lt;li&gt;if padding logic changes&lt;/li&gt;
&lt;li&gt;if Android/iOS behavior differs later&lt;/li&gt;
&lt;li&gt;I’ve isolated it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  This Slowly Became My Default Style
&lt;/h2&gt;

&lt;p&gt;Now I do this for almost everything:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AppText → font scaling, typography updates&lt;/li&gt;
&lt;li&gt;AppButton → design system changes&lt;/li&gt;
&lt;li&gt;AppInput → validation, focus handling&lt;/li&gt;
&lt;li&gt;AppImage → caching, placeholders&lt;/li&gt;
&lt;li&gt;AppPressable → analytics hooks later&lt;/li&gt;
&lt;li&gt;Every time I hesitate and think&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;“Should I just use this directly?”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I remember how many times I’ve regretted that decision.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why This Matters (Real Talk)&lt;/strong&gt;&lt;br&gt;
React Native evolves fast.&lt;br&gt;
Your app doesn’t.&lt;/p&gt;

&lt;p&gt;So either:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You chase changes every year&lt;br&gt;
or&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You design your app to absorb them calmly&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Wrapping components doesn’t slow you down.&lt;br&gt;
Refactoring later does.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Final Thought&lt;/strong&gt;&lt;br&gt;
This isn’t about over-engineering.&lt;br&gt;
It’s about respecting the fact that change is guaranteed.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I don’t wrap components because I expect problems today.&lt;br&gt;
I wrap them because I know future-me will be tired.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And honestly?&lt;br&gt;
Future-me deserves better.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>programming</category>
      <category>jsx</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
