AZ-400 · Question #423
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 th
The correct answer is git clone --bare https://github.com/contoso /project1.git; cd project1.git; git push --mirror https://dev.azure.com/contoso /project1/_git/proj. 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
Exhibit
Answer Area
Drag items
Correct arrangement
- git clone --bare https://github.com/contoso /project1.git
- cd project1.git
- git push --mirror https://dev.azure.com/contoso /project1/_git/proj
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.
