Git & GitHub —
Version Control Assessment
Verify your understanding of Git version control and GitHub workflows for professional embedded systems development — from four-stage commits to CI pipelines.
About This Assessment
This assessment verifies that you understand how Git and GitHub are used in professional embedded software development, can apply safe version control practices, and are ready to collaborate and recover from common mistakes throughout the course.
Section A — Multiple Choice
10 questions covering core Git concepts, safety, and workflow.
Section B — Short Answer
5 questions requiring detailed written explanations.
Section C — Scenario-Based
4 real-world Git troubleshooting and decision-making scenarios.
Section D — Verification Checklist
16-item checklist confirming every Git and GitHub setup step.
Multiple Choice Questions
Each question shows the verified correct answer and the reasoning behind it.
Git manages files through four important stages. Understanding these stages makes every Git command easier to reason about, because every command operates on exactly one of them.
Every Git command operates on exactly one of these four stages. git add moves changes from the working directory to staging; git commit records them locally; git push uploads them to GitHub.
git add -p do that git add <file> does not?git add <filename> adds the entire file to staging. git add -p starts Patch Mode, where Git asks whether each small section (called a hunk) should be staged. This is useful when one file contains multiple unrelated changes — you can commit only the required change while leaving the rest for a separate commit.
git stash is most useful when:Sometimes you’re developing a feature when an urgent bug needs fixing in another branch. If your work is incomplete, Git prevents switching branches. git stash saves all uncommitted changes without creating a commit, so you can switch safely and restore with git stash pop.
git stash acts as a temporary drawer for unfinished work — save it, switch context, come back and pop it out exactly where you left off.
.gitignore critical for an embedded project?Embedded projects generate many temporary files during compilation (.pio/, build/, .vscode/, *.log). These increase repository size, change constantly, and can expose private information like Wi-Fi credentials. A .gitignore file tells Git which files and folders should never be tracked.
git reset --hard HEAD do?This command restores the project to the most recent commit, removing all modified files, staged changes, and uncommitted edits. The deleted changes cannot normally be recovered. Use this command with care.
git revert <commit> preferred over git reset for pushed commits?There are two ways to undo commits. git reset removes commits from history, rewrites the timeline, and is unsafe after pushing to GitHub. git revert creates a new commit that reverses the previous changes, keeps the complete history intact, and is safe for shared repositories.
git reset rewrites history — dangerous on pushed commits. git revert adds a new undoing commit and leaves history untouched.
Professional Git projects follow a standard commit message style — short, action-oriented, and in the imperative mood (as if giving an instruction).
GitHub repositories often contain important source code. With only a stolen password, an attacker could delete repositories, upload malicious code, access CI/CD secrets, and cause serious damage. With 2FA enabled, logging in also requires a second verification step, making unauthorized access significantly harder.
git merge main and git rebase main?Merge keeps the original branch history and creates a merge commit — safe for collaborative work. Rebase moves feature commits on top of the latest main branch, producing a clean, linear history, but rewrites commit history. For solo projects, rebase often creates a cleaner history; merge is generally safer for team collaboration.
A Git tag marks an important point in the project’s history. Tags are used to mark stable firmware releases, create GitHub Releases, track software versions, support OTA firmware updates, and allow developers to easily return to a previous stable version.
Short Answer Questions
Detailed written answers in your own words.
Committing and pushing after every work session is one of the most important Git practices. Even when a project is incomplete, saving current progress ensures the work is safely stored and recoverable.
- Prevents data loss. Computers crash, storage fails, and files get deleted. If the latest changes are already pushed to GitHub, the project can be restored at any time.
- Creates backup copies. GitHub acts as an online backup. Instead of keeping the only copy locally, code is safely stored in a remote repository.
- Makes debugging easier. Each commit is a checkpoint. If a bug appears after several changes, Git can compare commits to identify exactly when the problem was introduced.
- Encourages small, organized commits. Frequent commits each contain one logical change (“Add UART initialization”, “Fix SPI timeout”), which are far easier to review than one enormous commit.
- Helps collaboration. Everyone on the team can see the latest progress after each push, and the remote remains available from any computer.
Without regular commits, you risk losing work to hardware failure, struggling to locate the source of a bug, accumulating unmanageable commits, and accidentally destroying unfinished code with a careless git reset --hard.
Suppose we need to develop a new UART driver without affecting the stable main branch.
git stash first.git stash pop.# 1. Create and switch to the feature branch
git switch -c feature/uart-driver
# 2. Stage the driver files
git add uart_driver.c uart_driver.h
# 3. WIP commit
git commit -m "Add UART driver scaffold"
# 4. Switch to main (use git stash first if you have uncommitted changes)
git switch main
# 5. Fix the bug, commit, and push
git add .
git commit -m "Fix startup bug"
git push
# 6. Return to the feature branch (restore stash if applicable)
git switch feature/uart-driver
git stash pop # only if stash was usedmain branch. The main branch always compiles and runs correctly, while new features develop independently until they’re tested and ready to merge.If Wi-Fi credentials are pushed to GitHub, they should be treated as compromised immediately, even if the repository is private.
git push --force replaces the remote history with the cleaned version..gitignorewifi_credentials.h, secrets.h, and .env so Git never tracks them again.wifi_credentials_example.h with placeholder values. Users copy it and fill in their own credentials locally. The real credentials file stays untracked.A simple branching strategy keeps projects organized and prevents bugs from entering stable firmware.
Main branch: always contains stable, compiling, hardware-tested code. Only merge tested features into this branch.
Feature branches: one branch per new feature (feature/uart, feature/spi, feature/bluetooth). Keeps experimental code away from stable firmware.
Bug-fix branches: dedicated branches like fix/spi-timeout keep maintenance work organized.
Merge only after testing: a feature merges into main only after successful compilation, no build errors, and hardware testing.
Tag stable releases: create tags (v0.1, v0.5, v1.0) at each stable version so you can always return to a known-good state.
Main stays stable while features develop in isolation. Both branches merge only after testing, and a tag captures the stable release.
SSH keys provide a secure way to authenticate with GitHub without entering a password on every push or pull. An SSH key consists of two parts: a private key (stored securely on your computer, never shared) and a public key (uploaded to GitHub). Both keys work together to verify identity securely.
- Better security. SSH keys are cryptographically much harder to steal or guess than passwords.
- No password prompt. After setup,
git pushandgit pullwork silently and instantly. - Required by GitHub. GitHub removed password authentication for Git operations. Developers must now use SSH keys or Personal Access Tokens.
- Easy to revoke. If a device is lost, remove only that device’s SSH key from GitHub — no need to change the account password.
- Works in automation. SSH authentication integrates cleanly with CI/CD pipelines, build servers, and automation scripts.
Scenario-Based Questions
Real-world Git situations you’ll encounter in embedded development.
.gitignore. The commit has not been pushed yet. How would you clean it up?Since the commit has not yet been pushed, the mistake can be corrected safely without affecting anyone else.
git reset --soft HEAD~1 — removes the commit from history but keeps files intact.git restore --staged build/ (or .pio/ for PlatformIO projects) — unstages only the build directory while leaving source files staged..gitignorebuild/, .pio/, .vscode/, *.log, and *.tmp so these files are never committed again.git add . — Git will automatically exclude everything listed in .gitignore.git commit -m "Add source files and update gitignore"git status and git ls-files to confirm the build folder is no longer tracked, then push.git filter-repo or BFG Repo-Cleaner to remove the large folder from all history, then force-push. This is the same process as removing leaked credentials — treat a pushed large-file mistake as a history rewrite.Continuous Integration automatically builds and tests a project whenever new code is pushed to GitHub. Even a simple workflow significantly improves reliability by confirming that the project compiles on a clean machine every time.
The minimum useful workflow for a PlatformIO STM32 project should: trigger on every push and pull request, check out the repository, install PlatformIO, download all project dependencies, run pio run to compile the firmware, and report the result as a pass or fail status.
Even this minimal pipeline catches compilation errors before they become someone else’s problem, and confirms all dependencies are correctly configured.
When main has received new commits, the feature branch should be updated before merging. Both merge and rebase update the branch but produce different histories.
Creates a merge commit.
Safe for shared branches.
Best for team collaboration.
History is non-linear but complete.
No merge commit.
Creates a clean linear log.
Best for solo projects.
Easier to read but rewrites commits.
For solo embedded projects, rebase produces a cleaner, easier-to-read history. For team work, merge is safer as it doesn’t rewrite shared commits.
GitHub allows users to highlight up to six public repositories on their profile page. Pinned repositories are typically the first projects viewed by instructors, recruiters, and employers.
Choose the projects that best demonstrate your embedded systems skills: STM32 Driver Development, ESP32 IoT Project, BLE Application, FreeRTOS Project, LVGL HMI, or RS-485 Communication Project.
Pinning improves your professional profile by highlighting your strongest work, making your page more organized, and helping recruiters quickly evaluate your skills for internships and job applications.
Git & GitHub Setup Verification Checklist
Completing every item confirms the development environment is ready for version control, collaboration, CI, and all future embedded projects.
| Item | Verification Method | |
|---|---|---|
| ✅ | Git version ≥ 2.40 | git --version shows 2.40 or later |
| ✅ | Git Username Configured | git config --global user.name returns your name |
| ✅ | Git Email Configured | git config --global user.email returns your email |
| ✅ | Default Branch Set to main | git config --global init.defaultBranch main |
| ✅ | SSH Key Generated (ed25519) | Public and private SSH keys created successfully |
| ✅ | SSH Key Added to GitHub | SSH public key uploaded to GitHub account settings |
| ✅ | SSH Authentication Verified | ssh -T git@github.com shows successful authentication |
| ✅ | Two-Factor Authentication Enabled | GitHub account protected using 2FA |
| ✅ | Recovery Codes Saved | Recovery codes stored safely offline |
| ✅ | Repository Created | embedded-journey repository created on GitHub |
| ✅ | README.md Added | Project description committed |
| ✅ | LICENSE Added | MIT or another suitable license committed |
| ✅ | .gitignore Added | Ignore file committed with required patterns |
| ✅ | First Commit Pushed | Initial project uploaded to GitHub successfully |
| ✅ | GitHub Profile Completed | Profile photo, bio, and pinned repositories added |
| ✅ | VS Code Git Integration Working | Source Control panel detects the repository |
Verification Details
git --version → e.g. git version 2.45.1git config --global user.name → your namegit config --global user.email → your emailgit config --global init.defaultBranch → mainssh -T git@github.com → Hi username! You’ve successfully authenticated.embedded-journey is public and visible on GitHubgit log --oneline → shows Initial commit.gitignore contains .pio/, build/, *.log, .env, wifi_credentials.hRecommended .gitignore Content
.pio/
build/
.vscode/
*.log
*.tmp
*.swp
.DS_Store
Thumbs.db
.env
wifi_credentials.h
secrets.hSelf-Grade Rubric
| Criterion | Maximum Marks | Self Marks |
|---|---|---|
| All setup items completed | 14 | _____ |
.gitignore contains at least 8 relevant patterns | 4 | _____ |
| Commit messages follow professional conventions | 4 | _____ |
| GitHub Actions workflow added to a project | 3 | _____ |
Total Marks: 25
Best Practices Learned
- Commit changes frequently and push after every work session.
- Write meaningful commit messages in the imperative mood, under 50 characters.
- Keep the main branch stable — only merge tested, working code.
- Use feature branches for all new development.
- Ignore build artifacts, credentials, and system files using
.gitignore. - Protect the GitHub account with Two-Factor Authentication.
- Use SSH keys for secure, password-free authentication.
- Tag stable firmware versions (v0.1, v0.5, v1.0).
- Use GitHub Actions for Continuous Integration to verify every push compiles.
- Maintain a clean and professional GitHub profile with pinned repositories.
- Prefer
git revertovergit resetfor pushed commits. - Use
git stashwhen you need to switch context without losing WIP work.
Overall Summary
This assessment introduced the essential Git and GitHub concepts required for professional embedded software development.
Throughout this module, we learned how Git tracks changes using the four-stage workflow, how to safely manage code with commits, branches, stashes, and tags, and how to recover from common mistakes such as accidentally committing large build folders or exposing sensitive credentials.
We also explored professional development practices — writing meaningful commit messages, organizing work using feature branches, securing GitHub with SSH keys and Two-Factor Authentication, and using GitHub Actions to automatically verify that projects build successfully on every push.
Finally, we verified the complete Git and GitHub setup through a practical checklist, ensuring the development environment is fully prepared for future embedded systems projects. By mastering these concepts, developers can confidently manage source code, collaborate effectively, maintain clean project histories, and build reliable embedded software using industry-standard version control practices.
End of Assessment — Module 0.3
Embedded Systems Foundations — Assessment, Module 0.3: Git and GitHub