O truque básico é exportar um git bundle e então importá-lo novamente em um repositório recém-inicializado.
Note que o novo repositório não será compatível com o antigo - enquanto ele contém os mesmos commits, esta estratégia de migração não fornece nenhuma compatibilidade direta
Como migrar de repositório SHA1 para SHA256
git_bundle_migrate.sh
# Create new repo with SHA-256
git init --object-format=sha256 new-repo
# Move into old repo directory and create bundle
cd old-repo
git bundle create ../repo-bundle --all
# Move to new repo and unbundle
cd ../new-repo
git bundle unbundle ../repo-bundle
# Verify branches
git branch -aComo migrar de repositório SHA256 para SHA1
git_bundle_migrate_back.sh
# Create new repo with SHA-1
git init --object-format=sha1 new-repo
# Move into old repo directory and create bundle
cd old-repo
git bundle create ../repo-bundle --all
# Move to new repo and unbundle
cd ../new-repo
git bundle unbundle ../repo-bundle
# Verify branches
git branch -a
Check out similar posts by category:
Git
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow