2

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?

Chadit
  • 965
  • 2
  • 12
  • 27
  • forwarding this to the git tf dev – bryanmac Sep 04 '14 at 00:43
  • In a worst case scenario you could do a bulk check-out, overwrite all the files with the most recent version on disk and check back in. That will give you one massive check-in with all changes of that day. As long as you haven't branched and merged a lot that day, you'll be fine. – jessehouwing Sep 04 '14 at 00:50
  • One of the issues I was running into was on a rebase, git tfs and git tf would report that it had tfs changesets that were missing from the TFS server. So far the only solution I have found was to reclone the TFS repo, and do a diff on the files to copy the ones in that are newer locally, then bulk pushing those back to TFS... but I loose the missing changeset along with their comments/author – Chadit Sep 04 '14 at 10:18

1 Answers1

3

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.

neelsg
  • 4,802
  • 5
  • 34
  • 58
alexr
  • 96
  • 3