Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
223 views
in Technique[技术] by (71.8m points)

Gitlab to TFS migration of Android project

I have an android project in GitLab with multiple branches. I want to clone the repo in TFS with full history. I did not get any article which I clearly told about the process. Please suggest any way.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can import your GitLab repository into the project on your TFS server.

  1. 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

  2. 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

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...