AZ-400 · Question #423
AZ-400 Question #423: Real Exam Question with Answer & Explanation
To migrate a GitHub repository to Azure Repos while preserving all branches and history, you must first perform a bare clone of the SOURCE (GitHub) repository using 'git clone --bare https://github.com/contoso/project1.git', which captures all refs, branches, and history without
Question
Drag and Drop Question You have the repositories shown in the following table. You need to migrate the contents of the GitHub repository to the Azure Repos repository. The solution must ensure that the Azure Repos repository only contains branches and history from the GitHub repository. Which three commands should you run in sequence? To answer, move the appropriate commands from the list of commands to the answer area and arrange them in the correct order. Answer:
Explanation
To migrate a GitHub repository to Azure Repos while preserving all branches and history, you must first perform a bare clone of the SOURCE (GitHub) repository using 'git clone --bare https://github.com/contoso/project1.git', which captures all refs, branches, and history without a working directory. Next, you navigate into the bare clone directory ('cd project1.git') since bare clones create a .git-suffixed folder. Finally, 'git push --mirror https://dev.azure.com/contoso/project1/_git/proj' pushes all refs (branches, tags, and history) to the Azure Repos DESTINATION, ensuring only the GitHub content exists there.
Topics
Community Discussion
No community discussion yet for this question.