git-tfs is intended more for getting data from TFS to Git, but I think
it can be used the way you want to. There are two things you could
try, depending on whether you want to preserve history in TFS.
Note: I haven't tried either of these, so you might want to try
against a test instance of TFS to see if it works. Also, I'm assuming
that you just care about the master branch. If you care about other
branches, Philippe will be able to provide more information about how
to do that.
----------
If you don't need to preserve history:
1. Outside of any git repository or working folder, run `git tfs clone
https://server/tfs/Collection $/DestProject conversion`. This will
create a `conversion` git repository, and it should be empty and have
a commit or two that match the TFS project creating changesets.
2. `cd conversion`
3. `git remote add history <path-to-git-repo>` and `git fetch
history`. This will pull in history from the repository that you
created with git-svn.
4. Do a baseless merge (`git merge history/master`) to bring in the
current state from your git-svn's master branch. Up to this point,
everything in the "conversion" repository is local to it, and if
anything has gone wrong, you should be able to delete the conversion
repository and start over.
5. Checkin the current stuff to TFS (`git tfs checkin`). This will
create one changeset in TFS with all the content from the current git
repository.
----------
If you do need to preserve history, you'll want to check in to TFS
using a different command, and the baseless merge probably won't be
adequate.
Start with steps 1-3 from above.
4. Rebase the history onto your TFS branch by running: `git rebase
--onto master --root history/master`. This will apply all the commits
from your git-svn repository on top of the commits that were created
by `git-tfs`. This addresses the error you ran into ("no tfs parents
found"). Similar to the previous set of steps, you also have only
changed the "conversion" repository at this point, and can delete it
if something's gone wrong.
5. Use rcheckin to copy the commits to TFS (`git tfs rcheckin`). You
might want to look over the docs for rcheckin
(
https://github.com/git-tfs/git-tfs/blob/master/doc/commands/rcheckin.md)
before you run it, to see if there are any options you'd like to use.
-----------
If the conversion is successful, I would archive or delete the
repository that was created by git-svn. If you try to use it and
git-tfs, you will run into problems because the commit ids don't
match. I would either make "conversion" the new common git repository;
or have your team create their own git repositories with `git tfs
clone`, and use TFS as a sync point.
--
Matt
> --
> You received this message because you are subscribed to the Google Groups
> "git-tfs-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
git-tfs-dev...@googlegroups.com.
> To post to this group, send email to
git-t...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/git-tfs-dev.
> For more options, visit
https://groups.google.com/d/optout.