Bfg-repo-cleaner: commit hashes changed after using bfg cleaner, making superrepo tags useless -> unable to check out

Created on 31 Oct 2018  路  2Comments  路  Source: rtyley/bfg-repo-cleaner

This is what I did to clean up a git SUBMODULE repo
First I made a fork as a backup.

  1. git clone --mirror git://example.com/SUBMODULE_repo.git
  2. bfg --delete-folders folder --no-blob-protection SUBMODULE_repo.git
  3. cd SUBMODULE_repo.git
  4. git reflog expire --expire=now --all && git gc --prune=now --aggressive
    5.git push

Everything is clean, but the commit hashes of all commits were changed. This way, since the hashed are linked to super repo commits, I cannot checkout super repo commits anymore, since the corresponding hashes of commit in the supbmodule repo cannot be found any more. Is there a way, to clean up , but keep the commit hashes as they were?

Thanks in advance.

Most helpful comment

I am having a similar issue.
I fully expected the hashes to be different. However, it would be great if BFG could recreate tags on the new hashes.
Thoughts?

All 2 comments

Commit-hash changes are expected, unavoidable, and non-BFG-specific. Any tool rewriting a Git history producing a sane result will result in commit-hash changed.

You will need to update the commit pointers in any repos which point at this repo, or alias in some other way.

I am having a similar issue.
I fully expected the hashes to be different. However, it would be great if BFG could recreate tags on the new hashes.
Thoughts?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jmsaavedra picture jmsaavedra  路  5Comments

notslang picture notslang  路  5Comments

dpopiashvili picture dpopiashvili  路  5Comments

Sieabah picture Sieabah  路  4Comments

dwabyick picture dwabyick  路  8Comments