Categories

Category cover

Automation
43 posts

Category cover

Security
20 posts

Category cover

Notes
19 posts

Category cover

Personal Security
15 posts

Category cover

CISO
14 posts

Category cover

Infrastructure
12 posts

Category cover

Learning paths
9 posts

Category cover

OT/ICS
6 posts

Category cover

UNetLab
4 posts

Category cover

Books
3 posts

Category cover

Write-up
3 posts

Category cover

OSInt
2 posts

Category cover

My life
1 posts

Reinitialize a Git repository

Andrea Dainese
March 07, 2021
Post cover

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