Chapter 1 – Welcome to Your First Company
Story Starts Here...
Congratulations! 🎉
Aaj tumne ek software company join ki hai as a SQL Developer.
Manager tumhe laptop deta hai aur bolta hai:
Manager: "Please clone the project and start working on Task #145."
Tum sochte ho...
Git kya hai?
GitHub kya hai?
Clone kya hota hai?
Main branch kya hoti hai?
Mujhe code kahan likhna hai?
Ye confusion almost har fresher ko hota hai.
Is guide ke end tak tum ye sab confidently kar paoge.
Company Environment
Maan lo company ka naam hai ABC Technologies.
Ek HRMS project chal raha hai.
Project ke modules:
HRMS
├── Employee
├── Payroll
├── Attendance
├── Recruitment
├── Reports
└── Dashboard
Is project par 10 developers kaam kar rahe hain.
Tum Attendance module par kaam karoge.
Team Structure
Project Manager
│
┌─────────────┴─────────────┐
Team Lead QA Team
│
┌───────┼───────────┐
Dev A Dev B You
│
GitHub Repository
Sab developers ek hi project par kaam karte hain.
Question:
Agar sab ek hi files edit kare to kya hoga?
Isi problem ko solve karta hai Git.
Without Git
Maan lo tumhare paas project folder hai.
HRMS
Version1
Version2
Version3
Final
Final_New
Latest
Latest_Final
2 hafte baad kisi ko nahi pata chalega ki latest version kaunsa hai.
With Git
Git sari history automatically maintain karta hai.
Commit 1
↓
Commit 2
↓
Commit 3
↓
Commit 4
Kab kisne kya change kiya tha,
sab history me saved hota hai.
Real Office Conversation
Team Lead:
Himanshu, Attendance Report me Employee ID add kar do.
Tum:
Okay.
Ab tum directly coding start nahi karte.
Sabse pehle project download karte ho.
Step 1 – Clone the Project
Manager tumhe repository link bhejta hai.
https://github.com/company/hrms.git
Tum command run karte ho:
git clone https://github.com/company/hrms.git
Git kya karta hai?
GitHub Repository
│
▼
Your Laptop
│
▼
HRMS Project
Ab poora project tumhare laptop par aa gaya.
Step 2 – Open the Project
Visual Studio
VS Code
Visual Studio Code
Ya koi aur IDE.
Tum project open karte ho.
Folder structure kuch aisa dikhega.
HRMS
├── Controllers
├── Models
├── Views
├── Database
├── Reports
└── README.md
Step 3 – Check Current Branch
Sabse pehle check karo tum kis branch me ho.
git branch
Output
* main
Matlab tum Main branch me ho.
IMPORTANT
Yahi sabse common mistake hoti hai.
Naye developers directly Main branch me coding start kar dete hain.
Professional companies me aisa nahi hota.
Main branch usually protected hoti hai.
Tum directly usme push nahi kar sakte.
Step 4 – Pull Latest Code
Coding start karne se pehle latest code lena zaroori hota hai.
git pull origin main
Kyun?
Ho sakta hai kal kisi aur developer ne naye changes kiye ho.
Agar tum latest code nahi loge to baad me merge conflicts aa sakte hain.
Real Office Scenario
Developer A
Morning 9:00
Employee Screen
Developer B
Morning 9:15
Employee Screen
Dono same file edit kar rahe hain.
Agar tum latest code nahi loge,
to shaam ko conflict almost pakka hai.
Isliye har morning pehla command hota hai:
git pull origin main
Today's Task
JIRA me task mila.
Task #145
Add Employee ID column in Attendance Report.
Ab coding start karne se pehle ek aur important step hota hai.
Feature Branch banana.
Aur yahin se real Git workflow shuru hota hai.
Chapter 1 Summary
Aaj humne seekha:
Git company me kyun use hota hai.
Git aur GitHub ka basic role.
Project clone kaise hota hai.
Main branch par direct kaam kyun nahi karna chahiye.
Coding se pehle
git pullkyun zaroori hai.Real office workflow ki starting.
Chapter 2 – Feature Branch: Coding Start Karne Se Pehle Ye Step Kabhi Skip Mat Karna
Introduction
Pichle chapter me humne dekha ki project clone karne ke baad developer sabse pehle latest code pull karta hai.
Ab ek bahut important question aata hai.
Manager: "Task #145 start kar do."
Ab kya tum main branch me coding start kar doge?
Answer: No.
Real software companies me developers almost kabhi bhi main branch par direct development nahi karte.
Is chapter me hum samjhenge ki Feature Branch kya hoti hai aur har company ise kyun use karti hai.
Real Office Story
Monday Morning - 9:30 AM
Tum office pahuchte ho.
JIRA me ek task assign hua hai.
Task ID : HRMS-145
Description:
Add Employee ID column in Attendance Report.
Tum Team Lead ke paas jaate ho.
You
Sir, task start kar raha hu.
Team Lead
Great.
Pull latest code.
Create a feature branch.
Then start coding.
Notice karo...
Unhone ye nahi bola
Start coding on main branch.
Why Not Main Branch?
Maan lo project me 8 developers kaam kar rahe hain.
HRMS Project
│
┌─────────────┼─────────────┐
Dev A Dev B Dev C
│ │ │
Login Payroll Attendance
Sab alag modules par kaam kar rahe hain.
Agar sab direct main branch me changes push karenge to kya hoga?
Bugs aa sakte hain
Half completed code production me chala jayega
Dusre developers ka code break ho sakta hai
Rollback karna difficult ho jayega
Isi liye Feature Branch use hoti hai.
What is a Feature Branch?
Feature Branch ek temporary branch hoti hai jo kisi specific task ke liye banayi jati hai.
Example
main
│
├── feature/login
├── feature/payroll
├── feature/attendance-report
├── feature/export-excel
Har task ki apni branch.
Task complete hone ke baad branch merge kar di jati hai.
Real Example
Tumhara task hai
Add Employee ID in Attendance Report
To tum branch banaoge.
feature/attendance-report
Ya
feature/employee-id-report
Ye branch sirf isi task ke liye hogi.
Branch Naming Convention
Different companies different naming use karti hain.
Example
feature/login
feature/dashboard
bugfix/login-error
hotfix/payment
release/v2.1
Large companies generally task ID bhi include karti hain.
feature/HRMS-145-attendance-report
Ye best practice hai.
Creating a Feature Branch
Sabse pehle latest code lo.
git pull origin main
Ab branch create karo.
git switch -c feature/attendance-report
Older Git versions me
git checkout -b feature/attendance-report
Dono same kaam karte hain.
What Happens Internally?
Pehle
main
Command run
git switch -c feature/attendance-report
Ab
main
│
└── feature/attendance-report
Tum ab main me nahi ho.
Tum feature branch me ho.
Check Current Branch
git branch
Output
main
* feature/attendance-report
Star (*) batata hai ki tum currently kis branch me ho.
Folder Kya Duplicate Ho Jata Hai?
Ye beginner ka bahut common question hai.
Answer:
No
Git pura project copy nahi karta.
Git sirf ek naya pointer banata hai.
Example
main
↓
Commit A
↓
Commit B
↓
Commit C
Branch create hui
main
↓
Commit A
↓
Commit B
↓
Commit C
│
└── feature/attendance-report
Initially dono same commit ko point karte hain.
Jaise hi tum naye commits karoge, feature branch alag history bana legi.
Coding Start
Ab tum Attendance Report open karte ho.
Before
Employee Name
Department
Attendance
Requirement
Employee ID
Employee Name
Department
Attendance
Tum code modify karte ho.
Example
SELECT
EmployeeID,
EmployeeName,
Department,
Attendance
FROM AttendanceReport
Abhi ye sirf tumhari branch me hai.
Main branch par koi impact nahi hua.
Another Developer
Isi time Dev B Payroll module par kaam kar raha hai.
Uski branch
feature/payroll-tax
Dev C
feature/login-api
Sab safely parallel development kar rahe hain.
Isi wajah se companies Feature Branch strategy follow karti hain.
Daily Workflow
Har task ke liye almost same process hota hai.
Receive Task
↓
Pull Latest Code
↓
Create Feature Branch
↓
Write Code
↓
Test
↓
Commit
↓
Push
↓
Create Pull Request
↓
Review
↓
Merge
Ye workflow har software company me common hai.
Common Beginner Mistakes
Mistake 1
Coding directly on main branch.
❌ Wrong
Mistake 2
Ek hi branch me 10 alag tasks kar dena.
Example
feature/new-feature
Usme
Login
Payroll
Dashboard
Attendance
Sab kuch.
Ye bahut bada mistake hai.
Har task ki alag branch honi chahiye.
Mistake 3
Branch name
test
Ya
new
Ya
abc
Aise names kabhi use mat karo.
Always meaningful names use karo.
Example
feature/export-excel
Best Practices
✅ Ek task = Ek branch
✅ Branch create karne se pehle latest pull lo
✅ Meaningful branch name use karo
✅ Task complete hone ke baad merge karo
✅ Old feature branches delete kar do
Practice Exercise
Manager assigns you this task:
Task ID : HRMS-182
Add Export to Excel button.
Think and answer:
Branch name kya rakhoge?
Pehla command kya hoga?
Branch create karne ka command kya hoga?
Expected Answer:
git pull origin main
git switch -c feature/HRMS-182-export-excel
Chapter Summary
Is chapter me humne seekha:
Feature Branch kya hoti hai.
Companies direct main branch par coding kyun nahi karti.
Branch create kaise karte hain.
Branch naming convention.
Real office workflow.
Common mistakes.
Best practices.
Chapter 3 – Writing Code and Understanding git status
Introduction
Pichle chapter me humne feature branch create kar li thi.
Ab finally coding start karte hain.
Yahi wo stage hai jahan almost har beginner confuse hota hai.
Questions:
Maine file change ki hai, Git ko kaise pata chala?
git statuskya batata hai?git addkab karna chahiye?Commit kab karna chahiye?
Is chapter ke end tak tum ye sab practically samajh jaoge.
Real Office Story
Tuesday Morning
Manager ne tumhe task diya hai.
Task ID : HRMS-145
Add Employee ID column in Attendance Report.
Tum feature branch me ho.
git branch
Output
main
* feature/HRMS-145-attendance-report
Ab coding start karte hain.
Existing SQL Query
Project me ek Stored Procedure hai.
CREATE PROCEDURE SP_AttendanceReport
AS
BEGIN
SELECT
EmployeeName,
Department,
AttendanceDate,
Status
FROM Attendance
END
Requirement aayi hai
Employee ID bhi report me dikhna chahiye.
Tum query modify karte ho.
CREATE PROCEDURE SP_AttendanceReport
AS
BEGIN
SELECT
EmployeeID,
EmployeeName,
Department,
AttendanceDate,
Status
FROM Attendance
END
Bas itna change kiya hai.
Question:
Git ko kaise pata chalega ki file change hui hai?
Git Constantly Watches Files?
No.
Ye beginner ki sabse common misunderstanding hai.
Git continuously tumhari files monitor nahi karta.
Jab tum command chalate ho
git status
Tab Git current files ko last commit se compare karta hai.
First Command After Coding
Har developer almost har 10–15 minute me ye command chalata hai.
git status
Output
On branch feature/HRMS-145-attendance-report
Changes not staged for commit
modified:
AttendanceReport.sql
Ab iska meaning samajhte hain.
Meaning of "Modified"
Last Commit
↓
AttendanceReport.sql
Tumne file edit ki.
Ab
Current File
↓
AttendanceReport.sql (Modified)
Git bol raha hai
"Mujhe pata chal gaya hai ki ye file last commit ke baad change hui hai."
Lekin...
Abhi ye commit ka part nahi hai.
Working Directory
Ab ek bahut important concept.
Git me teen areas hote hain.
Working Directory
↓
Staging Area
↓
Repository
1. Working Directory
Ye tumhara actual project folder hota hai.
Example
HRMS
│
├── AttendanceReport.sql
├── Employee.sql
├── Payroll.sql
Yahin tum coding karte ho.
2. Staging Area
Ye ek temporary waiting room hai.
Git yahan poochta hai
Kya tum sure ho ki ye changes next commit me include karne hain?
3. Repository
Yahan permanent history save hoti hai.
Visual Example
Coding complete.
Working Directory
AttendanceReport.sql
(Modified)
Command
git add AttendanceReport.sql
Ab
Working Directory
↓
Staging Area
Abhi bhi commit nahi hua.
Sirf ready hua hai.
Why Staging Area?
Question
Direct commit kyun nahi?
Suppose tumne 5 files change ki.
AttendanceReport.sql
Employee.sql
Payroll.sql
Dashboard.js
README.md
Lekin commit me sirf AttendanceReport.sql bhejni hai.
To?
git add AttendanceReport.sql
Bas wahi file stage hogi.
Baaki nahi.
Ye bahut powerful feature hai.
Stage Current Changes
Command
git add AttendanceReport.sql
Ya sab files
git add .
Ab dobara status dekho.
git status
Output
Changes to be committed
modified:
AttendanceReport.sql
Notice difference.
Pehle tha
Changes not staged
Ab hai
Changes to be committed
Matlab
Ye file next commit me jayegi.
Real Office Example
Suppose tumne galti se
AttendanceReport.sql
Aur
appsettings.json
Dono change kar diye.
Status
modified:
AttendanceReport.sql
modified:
appsettings.json
Tumhe sirf report wali file commit karni hai.
Command
git add AttendanceReport.sql
Ab sirf wahi stage hogi.
Common Beginner Mistake
Har baar
git add .
Ye blindly mat chalao.
Kabhi kabhi unwanted files bhi stage ho jati hain.
Example
.config
temp files
logs
backup files
Commit me chale jayenge.
Professional developers pehle status dekhte hain.
Create First Commit
Ab changes stage ho chuke hain.
Command
git commit -m "Added Employee ID in attendance report"
Output
1 file changed
1 insertion(+)
Congratulations!
Tumhara pehla office task history me save ho gaya.
Good Commit Message
Bad
Update
Bad
Changes
Bad
Done
Good
Added Employee ID in attendance report
Good
Fixed duplicate attendance issue
Good
Added export to Excel feature
Commit message padhkar samajh aa jana chahiye ki kya change hua.
Check History
Command
git log --oneline
Output
5f2ad1 Added Employee ID in attendance report
c61a22 Initial Commit
Ab Git ki history update ho chuki hai.
Office Workflow Till Now
Receive Task
↓
Pull Latest Code
↓
Create Branch
↓
Write Code
↓
git status
↓
git add
↓
git commit
Abhi code sirf tumhare laptop me hai.
GitHub par nahi gaya.
Wo next chapter me dekhenge.
Common Mistakes
Mistake 1
Commit bina status dekhe.
Wrong.
Always
git status
Mistake 2
Huge commit.
Ek commit me
Login
Payroll
Attendance
Dashboard
Sab.
Wrong.
Ek logical task = Ek commit.
Mistake 3
Meaningless commit message.
Update
Wrong.
Best Practices
✅ Frequent commits karo.
✅ Har commit ek logical change represent kare.
✅ Commit message meaningful likho.
✅ Commit se pehle status check karo.
✅ Sirf required files stage karo.
Interview Question
Why do we use git status so frequently?
Sample Answer
git statusshows the current state of the repository. It tells us which files are modified, staged, or untracked. Developers use it frequently to ensure that only the intended files are committed.
Practice Exercise
Tumne ye files modify ki hain.
AttendanceReport.sql
Employee.sql
README.md
Sirf AttendanceReport.sql commit karni hai.
Questions
Status dekhne ka command?
Sirf ek file stage karne ka command?
Commit command?
Expected Answer
git status
git add AttendanceReport.sql
git commit -m "Added Employee ID in attendance report"
Chapter Summary
Aaj humne seekha:
Git modified files kaise identify karta hai.
git statuska actual purpose.Working Directory kya hoti hai.
Staging Area kyun hoti hai.
git addka use.Meaningful commit messages ka importance.
Real office workflow me commit kaise hota hai.
Chapter 4 – Git Push: Code Laptop Se GitHub Tak Kaise Jata Hai?
Introduction
Pichle chapter me humne apna pehla commit create kiya.
Receive Task
↓
Create Branch
↓
Write Code
↓
git add
↓
git commit
Ab ek important question hai.
Kya commit karte hi code GitHub par chala jata hai?
Answer: No.
Ye beginner ki sabse common misunderstanding hai.
git commit sirf tumhare laptop par history save karta hai.
GitHub par code bhejne ke liye alag command hoti hai.
git push
Is chapter me hum ye complete process samjhenge.
Real Office Story
Wednesday Morning
Tumne apna task complete kar liya.
Attendance Report me Employee ID successfully add ho gaya.
Tum Team Lead ko bolte ho.
You: Sir, task complete ho gaya.
Lead bolta hai.
Team Lead: Great. Push your code and create a Pull Request.
Ab tum sochte ho...
Push kya hota hai?
Local Repository vs Remote Repository
Sabse pehle ye difference samajhna bahut zaroori hai.
Your Laptop
↓
Local Git Repository
Aur
GitHub
↓
Remote Repository
Dono alag jagah hain.
Example
Your Laptop
Commit 1
Commit 2
Commit 3
GitHub
Commit 1
Commit 2
Abhi Commit 3 sirf tumhare laptop me hai.
GitHub ko uske baare me kuch nahi pata.
How Code Travels?
Write Code
↓
git add
↓
git commit
↓
Local Repository
↓
git push
↓
GitHub
Ye complete workflow har developer roz use karta hai.
Check Current Remote
Sabse pehle check karte hain ki project kis GitHub repository se connected hai.
Command
git remote -v
Output
origin https://github.com/company/hrms.git (fetch)
origin https://github.com/company/hrms.git (push)
Question
Ye "origin" kya hai?
What is Origin?
Origin sirf ek nickname hai.
Real URL
https://github.com/company/hrms.git
Git ise yaad rakhne ke liye
origin
naam de deta hai.
Isliye hum likhte hain
git push origin feature/HRMS-145-attendance-report
Na ki
git push https://github.com/company/hrms.git
Origin likhna easy hai.
First Push
Tum apni feature branch par ho.
Check karo.
git branch
Output
main
* feature/HRMS-145-attendance-report
Ab push karo.
git push origin feature/HRMS-145-attendance-report
Output
Enumerating objects...
Counting objects...
Writing objects...
Done
Congratulations!
Ab tumhara code GitHub par upload ho gaya.
Visual Workflow
Before Push
Laptop
Commit A
Commit B
Commit C
GitHub
Commit A
Commit B
After Push
Laptop
Commit A
Commit B
Commit C
GitHub
Commit A
Commit B
Commit C
Ab dono same state me hain.
What Happens Internally?
Git compare karta hai.
Laptop
Commit 1
Commit 2
Commit 3
GitHub
Commit 1
Commit 2
Git dekhta hai
Sirf Commit 3 missing hai.
To sirf wahi upload hota hai.
Pura project dobara upload nahi hota.
Isi wajah se Git bahut fast hai.
Office Scenario
Tumhari team me teen developers hain.
Developer A
feature/login
Developer B
feature/payroll
Tum
feature/HRMS-145-attendance-report
Teenon apni apni branches push karte hain.
GitHub
main
feature/login
feature/payroll
feature/HRMS-145-attendance-report
Sabka code safely separate branches me rehta hai.
Very Important
Push karne ke baad bhi
Main branch change nahi hoti.
Ye beginner ki dusri common misunderstanding hai.
Before
main
↓
Commit A
↓
Commit B
Tumhari Branch
feature/HRMS-145
↓
Commit C
Push ke baad bhi
main
↓
Commit A
↓
Commit B
Feature Branch
feature/HRMS-145
↓
Commit C
Main branch tab tak update nahi hogi jab tak Pull Request merge nahi hoti.
Verify Push
GitHub open karo.
Tumhari branch dikhne lagegi.
Branches
main
feature/login
feature/payroll
feature/HRMS-145-attendance-report
Ab Team Lead tumhara code dekh sakta hai.
Common Push Errors
Error 1
error: failed to push some refs
Reason
Kisi aur developer ne tumse pehle code push kar diya.
Solution
git pull
Latest changes lo.
Conflicts resolve karo.
Phir
git push
Error 2
Permission denied
Reason
GitHub login issue
Ya repository access nahi hai.
Error 3
src refspec does not match any
Reason
Branch ka naam galat.
Ya commit hi nahi hua.
Common Beginner Mistakes
❌ Push before commit.
git push
Commit hi nahi kiya.
Obviously kuch upload nahi hoga.
❌ Main branch me push.
git push origin main
Office me usually allowed hi nahi hota.
❌ Wrong branch push.
Current branch
feature/login
Push
feature/payroll
Result
Confusion.
Best Practices
✅ Push karne se pehle
git status
Run karo.
✅ Meaningful commits banao.
✅ Correct branch verify karo.
git branch
✅ Push ke baad GitHub par branch verify karo.
Real Office Conversation
Developer
Sir, code complete hai.
Lead
Commit kiya?
Developer
Yes.
Lead
Push kiya?
Developer
Yes.
Lead
PR raise kar do.
Notice karo.
Commit aur Push alag steps hain.
Chapter 5 – Pull Request (PR): Team Lead Tumhara Code Kaise Review Karta Hai?
Introduction
Pichle chapter me humne apna code GitHub par push kar diya.
Workflow abhi tak:
Receive Task
↓
Create Feature Branch
↓
Write Code
↓
git add
↓
git commit
↓
git push
Ab ek question aata hai.
Kya push karte hi code production me chala jata hai?
Answer: Bilkul nahi.
Software companies me push karna sirf ek step hai.
Uske baad aata hai Pull Request (PR).
Real Office Story
Thursday Morning
Tumne Attendance Report ka task complete kar diya.
Tum Team Lead ko message karte ho.
You: Sir, code push kar diya.
Lead reply karta hai.
Team Lead: Great. Raise a Pull Request.
Tum sochte ho...
Pull Request kya hoti hai?
What is a Pull Request?
Simple language me:
Pull Request ek request hoti hai jisme tum Team Lead se bolte ho:
"Maine feature complete kar diya hai. Please mera code review karke agar sab sahi ho to main branch me merge kar dijiye."
PR directly merge nahi karta.
PR sirf review ke liye request bhejta hai.
Real Life Example
Maan lo tumne school assignment complete kiya.
Kya teacher bina dekhe marks de deta hai?
Nahi.
Teacher pehle assignment check karta hai.
GitHub me bhi same hota hai.
Developer
↓
Code Complete
↓
Pull Request
↓
Team Lead Review
↓
Approved
↓
Merge
Current Situation
GitHub me branches:
main
feature/login
feature/payroll
feature/HRMS-145-attendance-report
Tumhari branch me changes hain.
Main branch abhi bhi old version par hai.
Create Pull Request
GitHub open karo.
Tumhe message dikhega.
feature/HRMS-145-attendance-report had recent pushes
Compare & Pull Request
Click karo.
Fill PR Details
Title
Add Employee ID column in Attendance Report
Description
Task ID : HRMS-145
Changes Done
- Added Employee ID in Attendance Report
- Updated Stored Procedure
- Updated Report Layout
Testing
- SQL Query Tested
- Report Validated
Good PR description reviewer ka time bachati hai.
Assign Reviewer
Company me generally reviewer hota hai.
Example
Reviewer
Rahul Sharma
Ya
Team Lead
Ab reviewer ko notification mil jayegi.
What Does Team Lead Do?
Lead PR open karta hai.
Usse sirf final output nahi dikhta.
Usse har line ka difference dikhta hai.
Example
Before
SELECT
EmployeeName,
Department,
AttendanceDate
After
SELECT
EmployeeID,
EmployeeName,
Department,
AttendanceDate
GitHub highlight karta hai.
+ EmployeeID
Reviewer ko turant pata chal jata hai ki kya change hua hai.
Code Review
Lead code padh raha hai.
Usse ek issue dikha.
Comment karta hai.
Please use EmployeeCode instead of EmployeeID.
Ya
Query optimization required.
Ya
Please add comments.
PR reject nahi hua.
Sirf changes request hui hain.
What Should You Do?
Kabhi bhi naya PR mat banao.
Existing branch me hi changes karo.
Example
SELECT
EmployeeCode,
EmployeeName,
Department
Save.
Commit.
git add AttendanceReport.sql
git commit -m "Updated EmployeeCode based on review comments"
Push.
git push
Bas.
PR automatically update ho jayegi.
Ye bahut important concept hai.
Common Beginner Mistake
Naye developers sochte hain.
Comment aa gaya.
Chalo naya Pull Request bana dete hain.
❌ Wrong
Ek hi PR me changes continue karte hain.
Reviewer Approves
Lead fir se code dekhta hai.
Sab sahi hai.
Click karta hai.
Approve
Ab PR green ho gayi.
Merge
Approval ke baad.
Merge Pull Request
Click.
Ab
feature/HRMS-145-attendance-report
ke commits
main
me aa gaye.
Visual Flow
Before Merge
main
↓
Commit A
↓
Commit B
Feature Branch
Commit A
↓
Commit B
↓
Commit C
After Merge
main
↓
Commit A
↓
Commit B
↓
Commit C
Ab main update ho gayi.
Delete Feature Branch
Task complete.
Ab feature branch ki zarurat nahi.
GitHub usually option deta hai.
Delete Branch
Ye best practice hai.
Kyuki ek project me hazaron old branches nahi rakhni chahiye.
Local Cleanup
Merge ke baad latest code lo.
git switch main
git pull origin main
Delete local branch.
git branch -d feature/HRMS-145-attendance-report
Ab tum next task ke liye ready ho.
Complete Office Workflow
Task Assigned
↓
Pull Latest Code
↓
Create Feature Branch
↓
Write Code
↓
git status
↓
git add
↓
git commit
↓
git push
↓
Create Pull Request
↓
Code Review
↓
Fix Review Comments
↓
git commit
↓
git push
↓
Approve
↓
Merge
↓
Delete Branch
↓
Pull Latest Main
Ye workflow almost har software company follow karti hai.
Ye bahut accha idea hai. Niche maine real office workflow ke hisab se Git commands ko sequence me arrange kiya hai. Agar tum SQL Developer ya Data Engineer ho to office me lagbhag isi order me ye commands use karoge.
Step | Command | Matlab (Hindi) | Kab Use Karte Hain | Real Project Example |
|---|---|---|---|---|
1 |
| Git install hai ya nahi check karna | First time | Naye laptop par Git verify karna |
2 |
| User name set karna | First setup | Pehli baar Git configure karna |
3 |
| Email set karna | First setup | Commit author set karna |
4 |
| Current configuration dekhna | Verification | Check karna ki name/email sahi hai |
5 |
| GitHub se project download karna | Company join karne ke baad | HRMS project clone karna |
6 |
| Repository kis GitHub se connected hai | Clone ke baad | Origin URL verify karna |
7 |
| Available branches dekhna | Daily | Main aur feature branches dekhna |
8 |
| Main branch par jana | New task se pehle | Latest code lene ke liye |
9 |
| Latest code download karna | Roz subah | Team ke latest changes lena |
10 |
| Nayi feature branch banana | Naya task | Attendance report feature |
11 |
| Repository ki current state dekhna | Coding ke baad | Kaunsi files modified hain |
12 |
| File me kya change hua dekhna | Commit se pehle | SQL query compare karna |
13 |
| Ek file stage karna | Commit se pehle | Attendance.sql stage karna |
14 |
| Sab files stage karna | Jab sab changes commit karne ho | Chhote project me |
15 |
| File ke uncommitted changes hata dena | Galti se edit ho gaya | SQL file restore karna |
16 |
| Staging se file hata dena | Galat file stage ho gayi | appsettings.json remove karna |
17 |
| Changes history me save karna | Task complete | "Added Employee ID" |
18 |
| Complete history dekhna | Audit | Sare commits dekhna |
19 |
| Short history | Daily | Recent commits dekhna |
20 |
| GitHub par code bhejna | Commit ke baad | PR banane se pehle |
21 | GitHub PR | Pull Request banana | Push ke baad | Review ke liye |
22 |
| Main branch par wapas jana | PR merge ke baad | Next task ke liye |
23 |
| Merged code lena | PR merge ke baad | Latest main update karna |
24 |
| Local branch delete karna | Task complete | Cleanup |
⚠ Merge Conflict Commands
Command | Matlab | Kab Use Hota Hai |
|---|---|---|
| Conflict wali files dekhna | Merge conflict ke baad |
| Conflict resolve hone ke baad stage karna | Resolve ke baad |
| Merge complete karna | Conflict fix hone ke baad |
| Merge cancel karna | Agar merge nahi karna |
📂 Branch Commands
Command | Matlab |
|---|---|
| Branch list |
| New branch banana |
| Branch change karna |
| Branch create + switch |
| Purana tarika branch switch karne ka |
| Local branch delete |
| Force delete |
🔄 History Commands
Command | Matlab |
|---|---|
| Complete history |
| Short history |
| Last commit details |
| Sab actions ki history |
↩ Undo Commands
Command | Matlab | Use Case |
|---|---|---|
| File restore | Commit se pehle |
| Unstage | Galat file stage ho gayi |
| Commit remove, changes bachaye | Message galat ho gaya |
| Commit remove + unstage | Default reset |
| Sab delete | Dangerous |
| Commit ko reverse karna | Production safe |
🌐 Remote Commands
Command | Matlab |
|---|---|
| Remote URL dekhna |
| Remote connect karna |
| Sirf latest info lana |
| Fetch + Merge |
| GitHub par upload |
📦 File Commands
Command | Matlab |
|---|---|
| File rename |
| File delete |
| Untracked files delete |
🚀 Advanced Commands
Command | Matlab |
|---|---|
| Temporary changes save |
| Stash wapas lana |
| Stash list |
| Release version banana |
| Clean history banana |
| Ek commit copy karna |
📅 Real Office Daily Workflow
Time | Command | Purpose |
|---|---|---|
9:00 AM |
| Main branch par aana |
9:01 AM |
| Latest code lena |
9:02 AM |
| New feature branch |
Coding |
| Changes check karna |
Coding |
| Changes verify karna |
After Coding |
| Stage changes |
After Coding |
| Local save |
After Coding |
| GitHub upload |
GitHub | Pull Request | Review ke liye |
After Merge |
| Main par aana |
After Merge |
| Latest merged code |
Cleanup |
| Branch delete |
Is table me lagbhag 95% commands cover ho gayi hain jo ek SQL Developer, Data Engineer, Backend Developer ya Software Engineer roz use karta hai. Advanced commands (bisect, worktree, submodule, etc.) specific scenarios me use hote hain aur daily workflow ka hissa nahi hote.