gittfsgit-tf

Git-TF push all changes to another TFS repository


I cloned TFS repo to my local Git and then tried to change TFS remote to another repository to transmit all the changesets to it using the following commands:

git tf --force configure http://tfs2012:8080/tfs/DefaultCollection $/ProjectName

git tf checkin

Afte that a got the following error:

git-tf: TF14019: The changeset 31129 does not exist

What's wrong?

PS: Old repository has a version 2010, and new one is 2012. New repository is empty


Solution

  • I would be remiss if I were to not mention that git-tf was not meant to be a replacement for a proper migration and integration tool.

    That said, if you want to try, you cannot simply git tf clone a repository and then git tf checkin to a different server. git-tf maps commits to changesets to ensure consistency in the git and TFS repositories. Thus when you change the remote, it goes looking for those changesets in the new server.

    If you really want to push this to the new server, you'll need to remove the changeset to commit map.

    The easiest and most robust way to do this - without messing with the configuration data - is to simply clone the git repository and set the cloned repository up with the new server. Then you can git tf checkin to it:

    $ git clone ~/path/to/repo ~/path/to/cloned_repo
    Cloning into cloned_repo...
    done.
    $ cd ~/path/to/cloned_repo
    $ git-tf configure https://youraccount.visualstudio.com/DefaultCollection $/YourProject
    Configuring repository
    $ git-tf checkin 
    Connecting to TFS...
    Checking in to $/YourProject: 100%, done.                            
    

    Since git-tf maps only a single TFS repository, this also allows you to do incremental moves. If, after the initial migration, there are new changesets you want to migrate, you can pull them to the cloned git repository, then push them to the new TFS server without re-reconfiguring.

    $ cd ~/path/to/cloned_repo
    $ git pull ~/path/to/repo
    $ git-tf checkin
    Connecting to TFS...
    Checking in to $/YourProject: 100%, done.