user6062181
user6062181

Reputation: 1

git-tfs , copy history from one TFS project to another TFS project

I'm trying to use git-tfs to copy code & history from TFS proj1 to TFS proj2; is this possible?

When I try the below commands it doesn't work, see below output.

git-tfs.exe clone --branches=auto https://dev.azure.com/[org] $/[proj1]/Trunk .

Fetching from TFS remote 'default'...

C4 = 06a07db54bcb866aeb4312a41f7594332b3c274e

C5 = c8c20487951790452cd5c750f7b4fd4aefe26b86

...

git-tfs.exe pull -r // not sure if this is needed

--> modify .git\config:

[tfs-remote "Trunk2"]

url = https://dev.azure.com/[org]

repository = $/[proj2]/Trunk

git-tfs.exe rcheckin -i Trunk2

No TFS parents found!

Upvotes: 0

Views: 226

Answers (1)

Philippe
Philippe

Reputation: 31227

I'm trying to use git-tfs to copy code & history from TFS proj1 to TFS proj2; is this possible?

I will consider that by 'TFS' you are talking about 'TFVC' which is the historic version control solution of TFS.

So, no, git-tfs was no written to handle this use case.

A specific behavior of git-tfs made at the beginning of its development made that it is not possible to do it as long as you want to migrate more than one branch.

Even if you want to migrate only one branch, it is not recommended to use git-tfs to do that.

Just for the story, I was in the exact same case than you, wishing to migrate the smoke tests of the git-tfs tests (disclamer: because I was at the time the main maintener of git-tfs) and I needed to migrate a TFVC history from CodePlex (that Microsoft was shutting down) to an Azure DevOps account. I asked to a microsoft guy if someone from their internal version control team know how to do it (with the constraint to keep the same timestamp for the changesets). And they had no solution :(

For your other problem fetching the TFVC url, there should be an explanation but there is not enough information and it depends strongly on your TFVC history.

And following my above answer, I don't think you still want to go this way.

So good luck because I don't know a solution to do that (but I'm far to be an expert on TFS and TFVC stuffs)

Upvotes: 0

Related Questions