tfsgit-tfsgit-tf

restore missing tfs changeset with git tf or git tfs


long story short, had a tfs server go down. the backups are a day old (not in my control).

we use git tfs and git tf to talk to the server. When I do a git tfs fetch, I get an error that there are missing changesets.

Is there a way to push those missing missing changesets from my local git to the tfs server?


Solution

  • If I understood the issue well, you should edit the git-tf file in the .git folder of the repository. This file contains changset<=>commit map and the number of the latest changeset downloaded from TFS. The file content might look something like the following:

    [git-tf "commits"]
      changeset-11705 = d45df44afd49402363e400ff9dd3e4e57730c146
      changeset-13531 = a6db40aa074c92dcef718f9fb0edf267518d01f4
      changeset-13532 = f67ffc2555136c251212894ce78f01fa33b4e249
      changeset-13533 = 9e6e0a05aa286dd3b80ef166f3dccd43714c84f4
      changeset-13534 = e0a0701569adc90aea54ed53071d146de5b03e95
      changeset-13535 = 26d7a3608174441760c94c3bc5d6f17b047d4ae4
      changeset-13536 = e377b2d726074b4e94f584983a2985b8750e0df7
    [git-tf "changesets"]
      commit-d45df44afd49402363e400ff9dd3e4e57730c146 = 11705
      hwm = 13536
      commit-a6db40aa074c92dcef718f9fb0edf267518d01f4 = 13531
      commit-f67ffc2555136c251212894ce78f01fa33b4e249 = 13532
      commit-9e6e0a05aa286dd3b80ef166f3dccd43714c84f4 = 13533
      commit-e0a0701569adc90aea54ed53071d146de5b03e95 = 13534
      commit-26d7a3608174441760c94c3bc5d6f17b047d4ae4 = 13535
      commit-e377b2d726074b4e94f584983a2985b8750e0df7 = 13536
    

    Suppose the changesets 13536 and 13535 are missing on the TFS server. If you remove the lines

      changeset-13535 = 26d7a3608174441760c94c3bc5d6f17b047d4ae4
      changeset-13536 = e377b2d726074b4e94f584983a2985b8750e0df7
    

    and

      commit-26d7a3608174441760c94c3bc5d6f17b047d4ae4 = 13535
      commit-e377b2d726074b4e94f584983a2985b8750e0df7 = 13536
    

    and modify the hwm value:

      hwm = 13534
    

    you should be able to resolve the issue.