Git-tfs trying to pull from old tfs server instead of our new one

My team transferred our tfs from an old server to a new one a little bit ago. We are using git tfs to manage our local changes and to push them into tfs.

However I am running into an issue when I clone a exsisting repo from tfs like so

  • How to revert a chunk of a file in the staging area?
  • Git alias replace GIT
  • How to get just one file from another branch, but which does not exist in the current branch?
  • Private Git on OpenShift
  • Start using Eclipse GIT with an existing project … project files get moved
  • Avoiding merge conflict
  • git tfs clone $/project "myrepo"

    Git is able to connect to the new server and pull everything down. I can then make changes and commit them with no problem. It isn’t until I try to do a git tfs pull or git tfs checkintool this I get an error saying:

    Unable to locate a remote for <http://our.old.tfs/tfs>$/project

    When I check the config the url is defined as so I do not know where it is getting the idea to pull from the old server.

    I have tried deleting the remotes section from the config file and do a git tfs init [remote] but still the same error comes up. I have even scraped the repo and started with a fresh clone but still the same thing. It always points to the old server and not the new one.

    I have been looking online for hours but with no luck in finding a solution. Please let me know if you can provide any helpful advice!

    Thank you in advance!

  • What happened after pushing my local repository to github?
  • Reverting a pull request completely
  • Commit within a pre-push to update version
  • Changing source branch for PR on Github
  • Excluding Library folder from Git for Unity project causes scene to be lost
  • laravel blade files, Your local changes would be overwritten by merge
  • 2 Solutions collect form web for “Git-tfs trying to pull from old tfs server instead of our new one”

    I actually found my answer so I will post it here in case anyone else runs into the same issue!

    You have to add your old url to the list of legacy-urls like so:

    git config tfs-remote.default.legacy-urls http://your.old.url/

    I hope that helps for anyone that has or will be pulling their hair out in the future!

    Or edit the config file located under .git and change the url to the new location and add the legacy url.

    [tfs-remote "default"]
        url =
        legacy-urls = http://your.old.url
    Git Baby is a git and github fan, let's start git clone.