Module 12 Capstone Part 3: Release and Emergency Fixes
·DevOps

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

  1. The Version: Your team decides your app is ready for "Version 1.0."
  2. Tagging: Create an annotated tag on your main branch:
    git tag -a v1.0.0 -m "Initial stable production release"
    
  3. Verification: Run git show v1.0.0 to 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.

  1. Panic Check: Run git log. Observe that your history is gone.
  2. The Rescue: Run git reflog.
  3. Identify: Find the SHA-1 ID of where your main branch was before you ran the reset (look for the line just above the "reset: moving to HEAD~10" line).
  4. The Jump:
    git reset --hard <SAFE-SHA-1>
    
  5. The Miracle: Run git log again. Notice that every single commit is back exactly where it belongs.

Phase 8: Archive and Cleanup

  1. Final Sync: Ensure your submodule is also clean and up-to-date.
  2. Grep Check: Run git grep "TODO" to ensure you didn't leave any development notes in your production code.
  3. 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.

Subscribe to our newsletter

Get the latest posts delivered right to your inbox.

Subscribe on LinkedIn