CertLumen

Microsoft DevOps Engineer Expert (AZ-400) · Section 2 · 13% of the exam

Recover specific data by using Git commands

One of the objectives of the Exam AZ-400: Designing and Implementing Microsoft DevOps Solutions exam, in the section “Design and implement a source control strategy”. Here is what it covers, the points to remember and a question to try.

What it covers

Tags mark releases, reflog and revert get work back, and history-rewriting tools remove secrets and huge files for good. This lesson shows when to use each Git command, how Azure Repos and GitHub support tagging and restoring branches and repositories, and why removing data from a shared repository takes more than a delete commit.

Points to remember

  • Annotated tags store tagger, date and message (can be signed); lightweight tags are just names. The Azure DevOps portal creates annotated tags only.
  • Tags are not pushed by default: git push origin <tag> or --tags; delete remotely with git push origin --delete <tag>.
  • Azure Repos: Create tag permission for Contributors; Force push at repository or All tags level to delete a tag.
  • Use revert on shared branches (adds history) and reset locally (rewrites); revert a merge with -m 1.
  • git reflog and git branch rescue <sha> recover work after reset, rebase or branch deletion in your own clone.

Try a question

In Azure Repos, a release engineer with the Contributors role tries to delete the tag v1.0.0 from the Tags view, and the action is denied. Which permission is required to delete a tag?

  1. ACreate tag at the repository level or on the project, which allows deleting tags as well as creating them
  2. BEdit policies at the repository level in addition to Manage permissions on the repository
  3. CBypass policies when completing pull requests
  4. DForce push at the repository level or the All tags level
Show the answer

D. Deleting a tag needs the Force push permission at the repository level or at the All tags level (which inherits from the repository). Contributors get Create tag by default but not Force push, which is not set for any default group.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Tags, recovering data and removing data from Git teaches this objective (about 45 minutes), and 16 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 86 objectives · Next objective →