
Module 12 Capstone Part 3: Release and Emergency Fixes
Handle the pressure. In Part 3 of the Capstone, you will create an official release tag and then practice a high-stakes disaster recovery using the git reflog.
Module 12 Capstone Part 3: Release and Emergency Fixes
Congratulations! Your code has been merged and is ready for the world. In the final practical part of our capstone, we handle the "Production Lifecycle."
Phase 6: The Official Release
- The Version: Your team decides your app is ready for "Version 1.0."
- Tagging: Create an annotated tag on your
mainbranch:git tag -a v1.0.0 -m "Initial stable production release" - Verification: Run
git show v1.0.0to see your metadata and the state of the code at that milestone.
Phase 7: The Emergency (The Reflog Test)
It’s 4 AM. You are tired. You meant to add a tiny fix, but you accidentally ran:
git reset --hard HEAD~10
DISASTER: You've just deleted the last 10 commits, your merge history, and your tags are pointing to the wrong place.
- Panic Check: Run
git log. Observe that your history is gone. - The Rescue: Run
git reflog. - Identify: Find the SHA-1 ID of where your
mainbranch was before you ran the reset (look for the line just above the "reset: moving to HEAD~10" line). - The Jump:
git reset --hard <SAFE-SHA-1> - The Miracle: Run
git logagain. Notice that every single commit is back exactly where it belongs.
Phase 8: Archive and Cleanup
- Final Sync: Ensure your submodule is also clean and up-to-date.
- Grep Check: Run
git grep "TODO"to ensure you didn't leave any development notes in your production code. - The Alias: Use your
lg(log graph) alias to take one final look at your beautiful, linear, professional history.
graph TD
Stable["Stable v1.0.0"] --> Mistake["Accidental Hard Reset"]
Mistake --> Void["Empty History"]
Void -- "Identify in Reflog" --> Recover["git reset --hard [SAFE ID]"]
Recover --> Stable
Capstone Progress Check
By the end of Part 3, you should have:
- Officially versioned a software product.
- Recovered from the most feared disaster in Git.
- Performed final production quality checks.
Status: Project delivered. You have survived the Capstone.
Next Lesson: Course Conclusion and Certification. We’ll wrap up the journey and look at the path ahead for your engineering career.