So here's what you need to know:
I have been attempting to update Repo B by doing the following:
git submodule init
cd repo-b/repo-a
git checkout $hash
where $hash
is the exact same commit in Repo A that we used to point to, but with the new hash because history was rewritten.I keep getting this error:
fatal: reference is not a tree: 01b517847508dd5942887950e4a5ab1468bb21b4
I can't figure out what I'm doing wrong, every answer I've seen seems to imply that I should be able to checkout a specific hash in the submodule and then commit that change to the repo.
Also, just for clarification, I did confirm that my hash is correct and exists by checking it out in the new (GitLab) Repo A, so it's there.
I found a solution! I can't explain why it works, but it fix the error.
I had previously tried this with a git submodule update
between step 3 and step 5, and that didn't seem to work. However:
git submodule init
git submodule update --checkout
Did in fact allow the hash checkout to succeed in the submodule.