'Migrate Gitlab repo to TFS (Azure DevOps) include history and branches
I've been searching the entire day and haven't found any answer yet. I found how to migrate from TFS to Gitlab. I wonder if there is any easy way to do the opposite - I mean to mirror or clone a gitlab repository to TFS with all of the branches (around 10 for each project) and history.
Thanks for any help.
Solution 1:[1]
I would propose the following:
- Create an empty repository in Azure DevOps.
- Create a clone of that repo on your local drive.
- Add a repo from gitlab as a remote named
gitlabto your local repogit remote add gitlab https://gitlab.com/xxx/test.git. - Fetch all branches and tags from gitlab
git fetch --tags gitlab. - Push everything to Azure using
git push --all --tags origin.
Now all branches and tags you have in gitlab should also be in Azure DevOps.
If you have multiple repos (it is not clear from your question) repeat the same process for every repo.
Solution 2:[2]
If your TFS (Azure DevOps Server) can access the Gitlab repo, then you just need to import the Gitlab repository to Azure DevOps Server.
Get the repo URL, eg : https://gitlab.com/xxx/test.git, then enter the credential to import.
Otherwise, you can manually import a repo from Gitlab to TFS (Azure DevOps Server).
Please see Import a Git repo and Move Git repositories to another project with full-fidelity history for details.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | SebDieBln |
| Solution 2 |

