🔥 Advanced Tasks 15–20 Open Source

Git & GitHub —
Advanced Concepts

Fork workflows, pull requests, submodules, discussions, tags, and branch protection — the professional tools used in open-source and embedded firmware projects worldwide.

CoversTasks 15–20 from the assessment
Sections7 topics
LevelIntermediate → Professional
1Collaboration

Fork a Repository

A Fork is your personal copy of someone else's GitHub repository. You cannot directly modify a repository you don't own — forking creates your own copy where you have full write access.

john/ESP32-Dashboard original repository Fork satwik/ESP32-Dashboard your copy — full access Modify Your Changes improved code Pull Request — "Please merge my improvements"

Fork → Modify → Pull Request. The standard open-source contribution workflow.

bash — after forking on GitHub
# Clone YOUR fork (not the original)
git clone https://github.com/satwik/ESP32-IoT-Dashboard.git

# Always create a feature branch — never work on main
git switch -c fix-readme-typo
💡
Fork = Personal Sandbox
You can experiment freely in your fork. Break things, try new ideas, make mistakes — none of it affects the original project until you deliberately send a Pull Request.
2Collaboration

Pull Requests

A Pull Request (PR) is a formal request to merge your changes into another repository. It's how open-source contribution works worldwide.

bash — the PR workflow
git status                           # check what changed
git add README.md                    # stage the file
git commit -m "Fix typo in README"   # commit
git push origin fix-readme-typo     # push the branch

Then on GitHub, navigate to your fork. GitHub shows a Compare & Pull Request banner. Click it, write a clear title and description, and click Create Pull Request.

🔎

Code Review

Maintainers read your changes and can leave comments, suggestions, or approve them.

🌟

Quality Gate

CI checks run automatically on PRs — code must pass before it can be merged.

👥

Portfolio Proof

Merged PRs are visible on your GitHub profile and prove real-world collaboration experience to recruiters.

3Advanced Features

Git Submodules

A Submodule allows one Git repository to contain another Git repository. Used in embedded projects to include shared libraries (FreeRTOS, LVGL, OLED drivers) as tracked dependencies.

ESP32-Weather-Station (main project) src/ platformio.ini lib/oled-library/ Separate Git repo · pinned to commit abc123

The parent project tracks the submodule at a specific commit — always pinned to the version you tested with.

bash — adding a submodule
git submodule add https://github.com/user/oled-library.git lib/oled
git commit -m "Add OLED library as submodule"
git push

Git creates a .gitmodules file tracking the URL and version. Common in embedded projects for FreeRTOS, LVGL, TensorFlow Lite, and ESP-IDF components.

💡
Real-Life Analogy
Building a car — you don't manufacture the tyres, battery, or GPS yourself. You use components made by specialists and track which version of each part you used. Submodules work identically.
4Advanced Features

GitHub Discussions

Discussions are community forums built directly into repositories — a space for conversations that aren't bug reports or feature requests.

Issues — work tracking
Bug Reports Feature Requests Assigned Tasks Example: "Fix UART timeout bug"
Discussions — conversations
Ideas and Suggestions Community Q&A Design Decisions Example: "Should we add MQTT support?"

Enable Discussions

Repository → Settings → Features → Discussions → Enable. Then open the Discussions tab, click New Discussion, select a category (General, Ideas, Q&A), and start the conversation.

Why Discussions Matter
They help gather user feedback, engage your community, generate ideas, and give users a place to ask questions without cluttering the Issues tracker with non-bug content.
5Advanced Features

Git Tags

A Tag is a permanent label attached to a specific commit. Unlike branches (which move forward), tags stay fixed — making them perfect for marking firmware releases.

bash — tagging a release
git tag -a v1.0.0 -m "First stable firmware release"
git push origin v1.0.0    # push this specific tag
git push --tags            # push all tags at once
git tag                    # list all tags
FeatureBranchTag
Moves forward?✅ Yes❌ No — stays fixed
Used for development?✅ Yes❌ No
Used for releases?❌ Usually no✅ Yes
Can receive new commits?✅ Yes❌ No
💡
Memory trick
Branch = moving pointer. Tag = permanent milestone marker. For embedded firmware: tag every build you flash onto a customer device so you can always reproduce that exact version.
6Advanced Features

Branch Protection Rules

Branch Protection prevents unsafe changes from being pushed directly to important branches like main. Without protection, any team member can accidentally push broken code directly to the stable branch.

Configure Protection

Repository → Settings → Branches → Add branch protection rule → select main.

📋

Require Pull Requests

No direct pushes to main. All changes must go through a PR with review.

Require Status Checks

GitHub Actions must pass (build, tests, lint) before any merge is allowed.

👥

Require Reviews

At least one approving review required. No self-merging.

🔄

Require Up-to-Date

Branch must include latest main before merging — prevents stale PRs.

Professional Workflow With Protection

Developer creates feature branch ↓ Makes commits, pushes to GitHub ↓ Opens Pull Request ↓ GitHub Actions run automatically (CI) ↓ Team reviews the code ↓ All checks pass + review approved ↓ Merge into protected main branch
Benefits
Prevents accidental changes, improves code quality through review, keeps main always stable and deployable, ensures CI passes before any merge, and builds professional team habits.
7Summary

Professional Workflow Summary

Fork (for open-source) ↓ Clone ↓ Create Feature Branch ↓ Commit (frequently, with clear messages) ↓ Push ↓ Pull Request (with description) ↓ Code Review ↓ GitHub Actions checks pass ↓ Approval received ↓ Merge into Protected Main Branch ↓ Tag the Release ↓ Deploy (automated via Actions)
ConceptPurposeKey Command/Action
ForkPersonal copy of another repoGitHub UI → Fork button
Pull RequestRequest to merge changesGitHub UI → Compare & PR
SubmoduleRepo inside another repogit submodule add
DiscussionsCommunity conversationsRepo → Discussions tab
TagPermanent release markergit tag -a v1.0.0
Branch ProtectionPrevent unsafe changesSettings → Branches
🚀 Golden Rule
  • Always work on feature branches — never commit directly to main.
  • Use PRs for everything — code review makes code better, always.
  • Protect main with branch rules — keep it always stable and flashable.
  • Tag every release — you must be able to reproduce any firmware version exactly.
  • Use submodules for shared libraries — pin external dependencies to known-good versions.
  • This is the workflow used in professional software, firmware, embedded systems, DevOps, and open-source projects worldwide.

Git & GitHub — Advanced Concepts · Embedded Systems Foundations