Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Azure DevOps Services | Azure DevOps Server 2022 - Azure DevOps Server 2019
If you're planning to consolidate multiple Azure DevOps projects into one, you're probably wondering:
Category | Requirements |
---|---|
Project access | Member of a project. |
Permissions | - View code in private projects: At least Basic access. - Clone or contribute to code in private projects: Member of the Contributors security group or corresponding permissions in the project. - Set branch or repository permissions: Manage permissions permissions for the branch or repository. - Change default branch: Edit policies permissions for the repository. - Import a repository: Member of the Project Administrators security group or Git project-level Create repository permission set to Allow. For more information, see Set Git repository permissions. |
Services | Repos enabled. |
Tools | Optional. Use az repos commands: Azure DevOps CLI. |
Note
In public projects, users with Stakeholder access have full access to Azure Repos, including viewing, cloning, and contributing to code.
Category | Requirements |
---|---|
Project access | Member of a project. |
Permissions | - View code: At least Basic access. - Clone or contribute to code: Member of the Contributors security group or corresponding permissions in the project. |
Services | Repos enabled. |
As shown, you need to move the MigrationDemo repo, from the FabrikamOld to the new Fabrikam team project.
You have two options as outlined below. Import functionality is easier, but is only available in Azure DevOps Services and TFS 2017 Update 1 and above.
Using the Import Repository feature, you can import a Git repository to your team project from Team Foundation Server (TFS), Azure Repos or any other Git source code provider like GitHub. Review the import repository documentation for more details.
From the code explorer, click on the repo name. Choose New Repository from the list, select Git as the type, and give it a name.
Once the repo is created, you are presented with step-by-step instructions to quickly get started. Copy the Clone URL
to your clipboard.
Important
Clear the Automatically create links for work items mentioned in a commit comment if you are importing from a different project collection or a foreign git repository. Azure DevOps will otherwise associate the commits to existing work items of unrelated team projects in the team project collection.
Switch to a Developer Command Prompt and path to your local (source) repository for the MigrationDemo repo in FabrikamOld. Run the git clone --mirror
command, using the Clone URL from above.
Command Line:
git clone --mirror https://demo-fabrikam.visualstudio.com/DefaultCollection/Fabrikam/_git/MigrationDemo
As shown, the clone --mirror
is redundant in this case, as the remote repository is bare. It is used here as a safe and easy way to set up the remote.
Run the git push
command to push the local changes to the remote (target) repo.
The --mirror
option is used with both the clone and push command. The option ensures that all branches and other attributes are replicated in the new repo.
Switch to the Azure DevOps web portal and validate the new repository and the history in the CODE hub.
Verify that all your branches were moved over to the new repo.
Verify that the permissions and policies are correctly configured for the new repo. You can configure the security after step 1, or at this stage. Reconfigure your builds to connect with the new repo. Lastly, notify users of the original repo to update their remotes in Visual Studio, or running the git remote set-url origin
command.
> git remote set-url origin https://demo-fabrikam.visualstudio.com/DefaultCollection/Fabrikam/_git/MigrationDemo
Important
Remember to clean up the original project by either deleting the repo (be careful, there's no undo) or locking the branches so that no one accidentally keeps updating it.
For detailed information on planning your team project collections and team projects, refer to the TFS Planning, Disaster Avoidance and Recovery, and TFS on Azure Iaas Guide.
Authors: Jesse Houwing, Mike Fourie, and Willy Schaub | Connect with the authors and ALM DevOps Rangers
(c) 2016 Microsoft Corporation. All rights reserved. This document is provided "as-is." Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it.
This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes.
Events
17 Mar, 9 pm - 21 Mar, 10 am
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Migrate your repository by using GitHub best practices - Training
Learn to move your existing project to GitHub from a legacy version control system.
Certification
Microsoft Certified: DevOps Engineer Expert - Certifications
This certification measures your ability to accomplish the following technical tasks: Design and implement processes and communications, design and implement a source control strategy, design and implement build and release pipelines, develop a security and compliance plan, and implement an instrumentation strategy.
Documentation
Import a Git repo into your project - Azure Repos
Import a repo from GitHub, GitLab, or Bitbucket into your project in Azure DevOps.
Set Git repository settings - Azure Repos
Learn how to configure a Git repository and its branches.
Fork your repository - Azure Repos
Learn how to isolate experimental or risky code using a forking workflow with Azure Repos Git repos.