OneDev server integrity when removing git blobs (OD-1645)
Closed
Santiago Chialvo opened 7 months ago

Hi Robin,

Hope you're doing well. The other day we discussed with a colleague the possibility of performing some actions to remove large files from git history, which is also known as removing blobs with tools such as git filter-repo. In any case, when using such tools the hashes of all commits changes too. We know this breaks the integrity of OneDev pull requests, issues, builds, etc. I know this for a fact because I did these actions when we had just 3 pull requests, and now those are not accessible anymore. But it would be truly painful to lose all references now that we had hundreds of issues, pull requests, and builds on our current server.

The question is, is there a tool on OneDev's side that can help to perform this action? We were thinking about some manual approach, by downloading OneDev's database, replacing old hashes with new ones, etc. But this is a very sensitive process and many mistakes might happen in between. Your advise will be precious for us.

Thanks in advance.

Santiago.

Robin Shen commented 7 months ago

You may follow below steps:

  1. Create a map from old commit has to new commit hash
  2. Back up OneDev database to a zip file
  3. Extract the zip file, and edit each file to replace all occurrences of old commit hash to new commit hash

You will also need to remove various info directories under the project's directory to force OneDev to rebuild cache.

Robin Shen changed state to 'Closed' 7 months ago
Previous Value Current Value
Open
Closed
Santiago Chialvo commented 7 months ago

Robin,

Thanks for the tip, we'll try those steps.

Santiago.

issue 1 of 1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-1645
Please wait...
Page is in error, reload to recover