You can import your GitLab repository into the project on your TFS server.
Directly import the repository:
This will automatically create a new repository with the same name on TFS server, and import all the branches and history from the GitLab repository.
![enter image description here](https://i.stack.imgur.com/pHcBR.png)
Import to an empty repository:
If you have created an empty repository into the project on your TFS server, you can see the "Import a repository" section on the page of this empty repository. Click the "Import" button to import your GitLab repository. This also will import all branches and history from the GitLab repository.
![enter image description here](https://i.stack.imgur.com/EtaML.png)
To view more details, you can see "Import a Git repo".
[UPDATE]
If your TFS server is TFS 2017 RTM or earlier, the "Import repository" feature is not supported on these older versions. You need to manually import the repository. See "Manually import a repo".
For example:
# Clone the source repo to a local folder
git clone --bare http://tfs2015:8080/tfs/DefaultCollection/BrightProj/_git/MyRepo
cd MyRepo.git
# Create the target repo on TFS server
# Push the local repository to the target repo
git push --mirror http://tfs2017:8080/tfs/DefaultCollection/BrightProj/_git/MyRepo
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…