By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Version control (Git) and code review (Pull Requests) are the backbone of collaborative, high-stakes engineering—especially when deploying in constrained environments (air-gapped networks, classified systems, or disaster response zones). As an FDE, you’ll often work in teams where a single misplaced commit can break a live system, violate compliance, or delay a critical mission. Example: You’re on-site at a defense contractor, deploying a real-time sensor fusion pipeline. The customer’s security team flags a hardcoded API key in your main branch during a pre-deployment audit. Without proper Git hygiene (e.g., .gitignore, pre-commit hooks, and PR reviews), you’d be scrambling to rewrite history under pressure—while the mission clock ticks.
main
.gitignore
FDE Rule: Rebase local branches, merge shared branches (e.g., main).
Pull Request (PR) / Merge Request (MR):
prod
FDE Use Case: PRs are your audit trail—critical for compliance (e.g., ATO, CMMC). Always require 2+ approvals for production changes.
Git Hooks (Pre-Commit, Pre-Push):
FDE Tool: Use pre-commit with hooks like detect-secrets to block API keys in code.
pre-commit
detect-secrets
Git LFS (Large File Storage):
FDE Trap: Air-gapped environments may not support LFS—plan for manual transfers.
Squash Merging:
FDE Rule: Use for feature branches; avoid for hotfixes (preserve history for debugging).
Git Submodules:
FDE Use Case: Critical for air-gapped deployments where dependencies must be vendored.
Signed Commits (GPG):
FDE Command: git commit -S -m "..." (configure GPG keys in GitLab/GitHub settings).
git commit -S -m "..."
Git Bisect:
FDE Example: Customer reports a crash in v1.2.3. Run git bisect start v1.2.3 v1.0.0 to pinpoint the faulty commit.
v1.2.3
git bisect start v1.2.3 v1.0.0
Protected Branches:
FDE Rule: Enforce this before the first deployment—retrofitting is painful.
Git Worktrees:
FDE Command: git worktree add ../hotfix hotfix-branch.
git worktree add ../hotfix hotfix-branch
Git Patch Files:
.patch
FDE Use Case: Deploying fixes to an air-gapped system via sneakernet.
Code Owners (CODEOWNERS file):
@security-team
*.yaml @infra-team
bash git init echo "*.env" >> .gitignore # Block secrets echo "*.key" >> .gitignore git add .gitignore git commit -m "Initial commit: add .gitignore"
bash git remote add origin git@customer-gitlab:project/repo.git git push -u origin main
bash git checkout -b feat/sensor-data-validation
feat
fix
docs
hotfix
PROJ-123
bash git add src/validation.py git commit -m "feat: add sensor data checksum validation (PROJ-123)"
bash git push origin feat/sensor-data-validation
bash git add src/validation.py git commit -m "fix: handle null checksums (addresses @alice's review)" git push origin feat/sensor-data-validation
git tag -a v1.2.4 -m "Add sensor validation"
v1.2.4
bash git checkout -b hotfix/sensor-crash v1.2.4 # Branch from the tag # Fix the bug (e.g., add a null check) git add src/validation.py git commit -m "hotfix: prevent crash on null sensor ID (PROJ-124)" git push origin hotfix/sensor-crash
bash git format-patch HEAD~1 # Creates 0001-hotfix-...patch
bash git am 0001-hotfix-*.patch
git-secrets
git revert
git pull
git fetch
git merge
config.yaml
bash git revert HEAD # Revert the bad commit git push origin main # Deploy the revert via CI/CD
Answer: Generate a patch file (git format-patch) or a tarball (git archive) of the changes, transfer it via USB, and apply it manually.Why: Air-gapped environments require offline-friendly workflows. Patch files are portable and don’t rely on network access.
git format-patch
git archive
Answer: Use git reflog to find the lost commit, then git cherry-pick or git reset --hard to restore it.Why: git reflog tracks all local changes, even after force-pushes. Always check it before panicking.
git reflog
git cherry-pick
git reset --hard
Answer: Use git filter-repo (or git filter-branch) to rewrite history and remove the password, then force-push to the branch (but never to main).Why: Rewriting history is the only way to fully purge secrets. Document the change in the PR description for auditability.
git filter-repo
git filter-branch
git rebase -i HEAD~5
git bisect start v1.0.0 v1.2.0
git format-patch HEAD~1
git worktree add ../debug debug-branch → Work on multiple branches.
git worktree add ../debug debug-branch
PR Checklist:
[ ] Tagged with the Jira ticket.
Field Traps:
⚠️ Delete feature branches after merging—keeps the repo clean.
Acronyms:
ACO: Approval Chain of Operations (who signs off on deployments).
Ports to Know:
22
443
80
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.