DevOpsGitHub

GitHub Mastery: Final Knowledge Test

TT
TopicTrick Team
GitHub Mastery: Final Knowledge Test

GitHub Mastery: Final Knowledge Test


Challenge 1: The Git Lifecycle

Scenario: You accidentally ran git add secret_key.env. You have NOT committed yet.

  • Question: What is the exact command to "Unstage" that one file while keeping it on your hard drive?
  • Answer Goal: Explain why git restore --staged is the professional's choice.

Challenge 2: Branching Strategy

Scenario: Your company releases software once per month and needs to maintain an "Emergency Hotfix" capability for production bugs while the team works on the next version.

  • Question: Which branching strategy would you recommend: Trunk-Based Development or GitFlow? Why?

Challenge 3: Automation (Actions)

Scenario: You want your GitHub Action to run ONLY when a Pull Request is opened against the main branch, but NOT when it's opened against a feature branch.

  • Question: Write the YAML trigger logic to achieve this.

Challenge 4: Security

Scenario: You suspect that an API key used in your Actions has been leaked to the internet.

  • Question: What are the three steps you must take in GitHub to fix this? (Hint: Rotate, Secret Scanning, Rotate).

Final Milestone

If you can confidently answer these four questions, you are ready to manage repositories for the largest companies on earth. The road ahead involves depth: mastering complex git rebase workflows, building custom GitHub Apps, and leading high-speed DevOps teams.

Share your achievement: Tag us on X/Twitter with #GitHubMastery to receive your digital graduate badge!


You have graduated from the GitHub Mastery Course — The future of collaboration is in your hands.