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 4 weeks ago
You may follow below steps:
Create a map from old commit has to new commit hash
Back up OneDev database to a zip file
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.
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.