Illia Levandovskyi
Illia Levandovskyi

Reputation: 1338

How to Duplicate Git repository hosted on TFS 2015

I have a Git repository hosted on Team Foundation Server 2015.

I need to leave it unchanged (in order to create new releases and do some maintenance).

And I want to create new version of the product (having a lot of branches and so on) with massive code change starting from the current state of the project.

Therefore I need to have the same Git repo alongside of given one (with all history available).

How to do this?

Upvotes: 1

Views: 1093

Answers (1)

jessehouwing
jessehouwing

Reputation: 115017

The steps are relatively simple:

  • Create a new empty repository on the TFS server. Make sure not to check the "Create default readme and .gitignore".
  • Create a local clone of the repository you want to mirror using git clone --mirror https://tfs/clone/url.
  • Add the new repository clone url to the local clone: git remote add target https://tfs/clone/new/repo/url
  • Push all to the target repo: git push target --mirror

Upvotes: 1

Related Questions