# 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.
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
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)
git checkout -b <your_working_branch>-25.12 git push -u origin <your_working_branch>-25.12
👉 This is where all development happens
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
git checkout openwrt-25.12 git pull upstream openwrt-25.12 git push
git checkout <your_working_branch>-25.12 git merge openwrt-25.12 git push
upstream/openwrt-25.12 → OpenWrt original
↓
openwrt-25.12 → mirror (DO NOT MODIFY)
↓
<your_working_branch>-25.12 → your firmware (MODIFY HERE)
❌ Do NOT commit to:
* openwrt-25.12 * main
✔ ALWAYS work on:
* <your_branch_name>-25.12
git checkout <your_working_branch>-25.12 make menuconfig make -j$(nproc)
* 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