📌 Version Control (Git & GitHub Basics)
🔹 What is Version Control?
Version control ek system hai jo software project ke code me hone wale sabhi changes ko track karta hai.
Isse developers ek team me kaam karte waqt apne changes ko merge, revert, aur manage kar sakte hain.
👉 Without version control: Agar team me 5 developers hain aur sab alag-alag code likh rahe hain, toh unke changes overwrite ho sakte hain.
👉 With version control: Har developer ka kaam alag branch me safe hota hai, aur easily merge ho jata hai.
🔹 Git Basics
Git ek distributed version control system hai. Matlab, har developer ke paas apne system me poora repository ka history hota hai.
✨ Basic Git Commands
-
git init
→ naya repository banane ke liye -
git clone <url>
→ kisi repository ko apne system me copy karne ke liye -
git status
→ file me kya changes hue hain dekhne ke liye -
git add <file>
→ file ko staging area me dalne ke liye -
git commit -m "message"
→ code changes ko save (commit) karne ke liye -
git push
→ apne commits ko remote repository (GitHub) par bhejne ke liye -
git pull
→ remote se latest changes lene ke liye -
git branch
→ naye branches dekhne/banane ke liye -
git merge
→ branches ko merge karne ke liye
🔹 GitHub Basics
GitHub ek remote repository hosting service hai jo Git ke sath kaam karta hai.
GitHub se kya hota hai?
-
Cloud me code save hota hai
-
Team collaboration easy ho jata hai
-
Pull Requests (PR) ke through ek dusre ke code ko review kar sakte hain
-
Issues aur Wiki se project management easy hota hai
Workflow Example (Team Collaboration)
-
Developer GitHub se repo clone karta hai
-
Apni branch me code likhta hai
-
git add
+git commit
karke apne changes save karta hai -
git push
se apni branch GitHub par upload karta hai -
GitHub par Pull Request raise karta hai
-
Team review karke changes approve karti hai
-
Code main branch me merge ho jata hai
🔹 Git vs GitHub
Feature | Git | GitHub |
---|---|---|
Definition | Local version control system | Remote hosting platform for Git repos |
Usage | Track code changes locally | Share & collaborate on Git repos |
Works Offline? | Yes | No (internet required) |
Example | git commit | Pull Requests, Issues, Actions |
0 Comments:
Post a Comment