Check git repo size : git count-objects -v
First checkout to the commit, which you want to make as the initial commit. Then run the following commands :
git checkout --orphan temp_branch
git add -A
git commit -am "Initial commit message"
git branch -D main
git branch -m main