Automating Threat Intelligence series
May 04, 2025
Reinitialize a Git repository
Sometimes we realize we committed something that should remain confidential. Or maybe we are ready to publish our open source project and we don’t want to publish the entire history too.
It’s a good time to reinitialize a git repository deleting old history:
mv .git/config config.git
rm -rf .git
git init -b master
mv config.git .git/config
git add .
git commit -m "Initial commit"
git push -u --force origin master