🚀 OpenWRT Github Fork Setup For Your Development
📦 Repository Setup
Option 1: Using Fork (Simple Way)
# Fork the repo from OpenWrt (via GitHub UI)
# Clone your fork
git clone [https://github.com/](https://github.com/)<your-username>/<your_repo>.git cd <your_repo_dir>
# Add upstream
git remote add upstream [https://github.com/openwrt/openwrt.git](https://github.com/openwrt/openwrt.git) git fetch upstream
</code> Note: Renaming your fork to <your_fork_repo> is optional but recommended.
Option 2: Without Fork
git clone https://github.com/openwrt/openwrt.git cd openwrt
# Replace origin with your repo
git remote remove origin git remote add origin [git@github.com](mailto:git@github.com):<your_github_username>/<your_github_repo_name>.git
# Add upstream
git remote add upstream https://github.com/openwrt/openwrt.git git fetch upstream
🌿 Branch Setup
Step 1: Create Base Branch (Clean Upstream Mirror)
git checkout -b openwrt-25.12 upstream/openwrt-25.12 git push -u origin openwrt-25.12
👉 This branch must remain unchanged (mirror of OpenWrt)
Step 2: Create Working Branch (Your Firmware)
git checkout -b <your_working_branch>-25.12 git push -u origin <your_working_branch>-25.12
👉 This is where all development happens
🛠️ Daily Development Workflow
git checkout <your_working_branch>-25.12
👉 Do all your changes here:
* Add packages * Modify configs * Patch kernel * Add LuCI apps
Then commit:
git add . git commit -m "your changes" git push
🔁 Updating from OpenWrt
Step 1: Update Base Branch
git checkout openwrt-25.12 git pull upstream openwrt-25.12 git push
Step 2: Merge into Your Branch
git checkout <your_working_branch>-25.12 git merge openwrt-25.12 git push
🧠 Branch Model (Important)
upstream/openwrt-25.12 → OpenWrt original
↓
openwrt-25.12 → mirror (DO NOT MODIFY)
↓
<your_working_branch>-25.12 → your firmware (MODIFY HERE)
⚠️ Rules (Do Not Break)
❌ Do NOT commit to:
* openwrt-25.12 * main
✔ ALWAYS work on:
* <your_branch_name>-25.12
🔧 Build Firmware
git checkout <your_working_branch>-25.12 make menuconfig make -j$(nproc)
🔥 Quick Summary
* openwrt-25.12 → upstream mirror
* <your_working_branch>-25.12 → your work
* Always update upstream → then merge
* Always build from <your_working_branch>-25.12