1

I have a multi-project repository in TFS 2017. I used git clone --mirror MyRepo to store it off on a file server. When I delete the repo in TFS

  1. Will the deletion reduce the database size for that collection in TFS?
  2. Will I need to run the stored procedure DeleteUnusedContent first?
  3. I'm guessing deleting the repository will not have an impact on WorkItems at all.?.?
Bill Greer
  • 3,046
  • 9
  • 49
  • 80

1 Answers1

0

In TFS, the Git repository is stored in the SQL database together with all the other data. Delete a git repo in a team project won't impact on workitems, as workitems are in a team project level, not in a git repo level.

You could script the cleanup process by referring to Clear Git repository, and use git fetch --all to make sure your local repo has all branch information, then use git branch --list -r to list all remote branches. With that you can easily script deleting these branches and pushing their deletion to the server.

Then use git update-ref refs/heads/master a12d48e2 (insert your own commitish) to reset the master.

Then git push --force --all to send everything back to the server.

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39
  • Dong I already mirrored the Repo. Will deleting it through the TFS Web UI reduce the size of the database? I'm guessing deleting the repo via the UI and running a shrinking operation on the database will save me some much needed room. Do you agree? – Bill Greer May 16 '18 at 12:24
  • 2
    From my test, it won't free the space immediately after you deleting the repo. You could check the solution from this case: https://developercommunity.visualstudio.com/content/problem/118099/reduce-tfs-database-size-after-deleting-almost-all.html – Cece Dong - MSFT May 17 '18 at 10:03