Migrate Hugo blog repository (but delete all Git commits)

Page content

My real case

  • Migrate repository from BitBucket to GitHub.
  • I could delete Commit histories.

What I’ve done

  1. Update .gitignore.
  2. Delete docs directory.
  3. Update netlify.toml
[build]
publish = "docs"
command = "hugo --gc --minify"

[context.production.environment]
  HUGO_VERSION = "0.87.0"
  1. rm -rf data #old dir structure
  2. rm -rf .git
  3. rm -rf theme/mainroad
  4. git init
  5. git submodule add git@github.com:Vimux/Mainroad.git themes/mainroad
  6. git config --global user.name atlex00
  7. git config --global user.email ...
  8. git commit
  9. git push origin master --force