Skip to content

Ashukr321/github-ruleset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ GitHub Branch Rulesets - Complete Guide (Hinglish)

GitHub Branch Rulesets ka complete guide jo aapko har ek rule ko samajhne mein madad karega — simple Hinglish mein likha gaya hai taaki koi bhi developer asaani se samajh sake!


📌 Kya hai Branch Rulesets?

Branch Rulesets GitHub ka ek powerful feature hai jo repository ke branches ko protect karta hai. Ye define karta hai ki:

  • Kaun branch create kar sakta hai
  • Kaun code push kar sakta hai
  • Merge karne se pehle kya conditions puri honi chahiye
  • Force push allowed hai ya nahi

Socho ek team mein 10 developers hain — agar sab log directly main branch mein code push karenge toh production mein bugs aa jayenge. Isliye hum rules lagaate hain taaki code quality maintain rahe! 💪


📂 Repository Structure

github-ruleset/
│
├── README.md                                    # Main documentation (ye file)
│
├── _00_introduction/
│   └── intro.md                                 # Ruleset kya hai aur kyun zaruri hai
│
├── _01_restrict_creations/
│   ├── usecase.md                               # Kab use karna hai
│   └── rule_explanation.md                       # Rule ki detail explanation
│
├── _02_restrict_updates/
│   ├── usecase.md
│   └── rule_explanation.md
│
├── _03_restrict_deletions/
│   ├── usecase.md
│   └── rule_explanation.md
│
├── _04_require_linear_history/
│   ├── usecase.md
│   └── rule_explanation.md
│
├── _05_require_deployments_to_succeed/
│   ├── usecase.md
│   └── rule_explanation.md
│
├── _06_require_signed_commits/
│   ├── usecase.md
│   └── rule_explanation.md
│
├── _07_require_pull_request_before_merging/
│   ├── usecase.md
│   └── rule_explanation.md
│
├── _08_require_status_checks_to_pass/
│   ├── usecase.md
│   └── rule_explanation.md
│
├── _09_block_force_pushes/
│   ├── usecase.md
│   └── rule_explanation.md
│
├── _10_require_code_scanning_results/
│   ├── usecase.md
│   └── rule_explanation.md
│
├── _11_practice_scenario/
│   └── practice_project.md                       # Real-world practice case study
│
├── _12_naming_conventions_and_best_practices/
│   ├── usecase.md                               # Kab follow karna hai
│   └── rule_explanation.md                       # Naming patterns & best practices
│
└── _13_bypass_master/
    └── bypass_explanation.md                     # Bypass list and options detail

🚀 Quick Overview — Sab Rules Ek Jagah

# Rule Name Kya Karta Hai Priority
00 Introduction Ruleset kya hai aur kyun zaruri hai 🟢 Essential
01 Restrict Creations Sirf authorized log hi new branch bana sakte hain 🟡 Medium
02 Restrict Updates Sirf kuch log hi branch mein code push kar sakte hain 🟡 Medium
03 Restrict Deletions Koi bhi important branch delete nahi kar sakta 🔴 High
04 Require Linear History Merge commits hatao, clean history rakho 🟢 Low
05 Require Deployments to Succeed Pehle deployment pass honi chahiye 🔴 High
06 Require Signed Commits Verified commits ensure karta hai ki code authentic hai 🟡 Medium
07 Require PR Before Merging Direct merge nahi, pehle Pull Request banao 🔴 High
08 Require Status Checks CI/CD tests pass hone chahiye merge se pehle 🔴 High
09 Block Force Pushes git push --force ko block karo 🔴 High
10 Require Code Scanning Security vulnerabilities check honi chahiye 🟡 Medium
12 Naming Conventions & Best Practices Rulesets ko properly name karo aur best practices follow karo 🟢 Essential
13 Bypass Master Bypass list aur unke actual meanings ki deep dive 🔴 High

🎯 Kaise Use Karein Ye Repository?

  1. _00_introduction/ se shuru karein — ye batayega ruleset kya hai aur humein ise kyun samajhna chahiye.
  2. Har folder mein jaao aur usecase.md padho — ye batayega kab ye rule use karna chahiye.
  3. rule_explanation.md padho — ye batayega rule kaise kaam karta hai aur kaise set karna hai.
  4. _11_practice_scenario/ folder mein jaao — wahan ek real-world project case study hai jismein 5 developers ki team mein rulesets kaise apply hote hain.
  5. _12_naming_conventions_and_best_practices/ mein jaao — wahan naming patterns aur team-size based templates milenge.
  6. _13_bypass_master/ ko check karein — taaki aap samajh sakein ki bypass list mein kin options ka kya matlab hai.

🏁 Getting Started

GitHub mein Rulesets set karne ke liye:

  1. Apne repo mein jaao → Settings
  2. Left sidebar mein → RulesRulesets
  3. New ruleset pe click karo
  4. Branch target select karo
  5. Rules choose karo aur Save karo!

💡 Pro tip: Pehle Disabled enforcement se test karo, phir Active karo production mein!


🤝 Contributing

Agar aapko lagta hai koi rule ki explanation aur acchi ho sakti hai ya koi nayi scenario add karni hai toh PR bhejo! 🎉


📜 License

MIT License — Free to use, learn and share!


Made with ❤️ for the Indian Developer Community 🇮🇳

About

A dedicated repository to understand and implement **GitHub Rulesets** for managing repositories, enforcing code quality, and maintaining secure development workflows.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors