gitgit-tfs

Change default remote for git-tfs repository


I am working against the customer's on premises TFS server using the git-tfs bridge. Yesterday they migrated their installation to a new version + changed the URL of the server, migrating all the history and the work items to a new instance.

Is there a way to remap my existing git repository to the new default remote?

I tried to manually edit the url property of the [tfs-remote "default"] so it points to the new address and run every possible cleanup* command. However, on a fetch attempt there is a bootstrapping process adding a new tfs-remote with the old URL to the config file.


Solution

  • You've got 2 solutions:

    1. Amend the git commit and replace the url in the metadata (something looking like that: git-tfs-id: [https://tfs.codeplex.com:443/tfs/TFS16]$/vtccds/trunk;C26497 ) to point to the new TFS.

    2. Create a backup of your original .git/config file:

       cp .git/config .git/config.bak
      
    3. Remove all the [tfs-remote] settings in the .git/config file.

    4. Just do a normal git tfs fetch from the command line.