Learn 🧠 All Concepts (20) 🤖 What is an LLM? 📚 RAG Explained ⚡ AI Agents 💻 Run AI Locally 🇮🇳 AI in India 📖 Learn Tracks 🔧 DevOps Track ⚙️ AI Ops Track 🗺️ AI Engineer Roadmap
Tools 🔧 AI Tools Directory 🔓 Open Source AI ⭐ Top GitHub Repos ✦ Claude Skill Repos 🚀 Ready-to-Deploy Projects
Build 🏗️ Build Hub 🎯 Master Prompts 🧩 RAG Agents 🚀 App Megaprompts
Workflows ⚡ All Workflows (22) 🎥 Text to Video 🎞️ Image to Video 🔊 Text to Speech ♻️ Automation
Resources 🧪 Colab Notebooks ⚙️ n8n Workflows 📈 Algo Trading 💰 Passive Income
🗂️ Browse All Topics About AItheGuru
Learn DevOps Arjun's first Git commit
DevOps Ch 1 / 10 Beginner
📁

Arjun's first Git commit

What is version control and why does everyone keep talking about Git?

⏱ 8 min 7 commands 4 takeaways
📁
In this chapter
Arjun
Fresh grad at a Pune startup
The story

Arjun joined his first job at a small startup in Pune. On day one, his senior Rohit asked him to "push the changes to Git." Arjun nodded confidently. He had no idea what that meant.

That evening, he typed his changes directly into the server. At midnight, the whole website crashed. Rohit called, half-asleep. "Did you overwrite my work?"

Arjun had. Three days of Rohit's code — gone.

This is the exact problem Git was built to solve.

What is Git?

Imagine you're writing a novel. Every day you save a new copy — novel_v1.doc, novel_v2.doc, novel_FINAL.doc, novel_FINAL_v2_ACTUALLY_FINAL.doc. You've done this. We've all done this.

Git is a smarter version of that. Instead of saving full copies, Git saves *snapshots of changes*. Every time you say "save this", Git records exactly what changed, who changed it, and when. This is called a commit.

Better yet — Git lets ten engineers work on the same codebase without destroying each other's work.

The three areas you need to know

Think of writing a WhatsApp message. You type it (working area), you read it before sending (staging area), you hit send (commit/repository). Git works exactly the same way.

1. Working directory — where you actually edit files. Your laptop.

2. Staging area — where you decide which changes to include in your next save. Like reviewing your message before sending.

3. Repository — the permanent record. Once committed, it's safe.

Arjun's first day with Git (the right way)

After the disaster, Rohit sat with Arjun for an hour. Here's what he taught him:

```bash

Start tracking a project

git init

Check what changed

git status

Stage the changes you want to save

git add filename.py

or add everything

git add .

Save with a message describing what you did

git commit -m "Add login page for user authentication"

See the history of all saves

git log

```

The commit message matters. "Fixed stuff" is useless at 3am six months later. "Fix login crash when email has special characters" is a lifesaver.

The golden rule Arjun learned

Never work directly on shared code. Always get the latest version first, make your changes, then save them back. In Git:

```bash

Get the latest version from the shared server

git pull

Make your changes, then...

git add .

git commit -m "Your clear description"

Send your changes to the shared server

git push

```

Arjun never overwrote Rohit's code again. He also got a reputation for writing excellent commit messages — which, six months later, helped him debug a production issue in 10 minutes instead of 3 hours.

What you should practice today

1. Install Git on your laptop — git-scm.com

2. Create a folder, run `git init`

3. Create a file, write something, do `git add .` then `git commit -m "my first commit"`

4. Run `git log` and see your history

That's it. You now understand what 90% of developers do every day.

Key takeaways

Git saves snapshots of changes, not full copies of files

Every save is called a commit — always write a clear message

The flow is: edit → git add → git commit → git push

Always git pull before starting work to get latest changes

Commands from this chapter
$ git init
Start tracking a project with Git
$ git status
See what files have changed
$ git add .
Stage all changes for next commit
$ git commit -m "message"
Save staged changes with a description
$ git push
Send commits to the remote server
$ git pull
Get latest changes from remote
$ git log
See commit history