2

I'm using git-tfs to migrate a TFVC branch (TFS 2013) to a Git repository (TFS 2013). I was able to successfully migrate the complete history using the below command.

git-tfs clone "<<TFS collection URL>>" "<<TFS Trunk branch URL>>" -u=<<username>> -p=<<mypassword>> --export --branches=none .

git remote add origin "URL of new git repository"
git push --all origin

However, as the TFVC branch was actively in use, it has got some more changes after the migration.

I tried to do a delta migration by using the --changeset option which should migrate only the changesets after the specified changeset. Now, git-tfs wouldn't simply let me migrate these new changesets in the existing git repository which was created previously.

I tried a few other options, like migrating to a different folder and then trying to pull from my existing git repo and merging the new changes but it didn't work as git errors out with:

"fatal: refusing to merge unrelated histories"

Any suggestions?

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
DevOpsy
  • 667
  • 1
  • 8
  • 18
  • 1
    What if you drop the git repo, then ask the dev team to hold on, run the same command again and let them continue in the git repo? Is this an option? – Yan Sklyarenko Oct 11 '18 at 05:29

2 Answers2

4

Normally, it's as simple as doing a

git tfs pull

See pull documentation

tried to do a delta migration by using the --changeset option which should migrate only the changesets after the specified changeset. Now, git-tfs wouldn't simply let me migrate these new changesets in the existing git repository which was created previously.

I don't know what you mean with that. There is no need of doing that...

Philippe
  • 28,207
  • 6
  • 54
  • 78
0

Steps to Migrate the specific change-set from tfs to gitlab using GIT-TFS:

1,git-tfs clone 'tfsRoot' 'tfsProject' . --branches=none -c='ChangeSetFrom' -t='ChangeSetTo'

2,git remote add origin 'gitlabProjectUrl'

3, git pull origin master --strategy-option ours --allow-unrelated-histories"

4,git push --set-upstream origin master

Note- it will keep only the tfs changes.

Jagan T
  • 30
  • 1
  • 5