I want to do an explicitly bad thing. I have a project where I am the only developer and I want to put it on Github but it's littered with absolutely terrible commit message. I want to basically re-init the repo so that when I push it to the public repo it doesn't have my asinine comments.
I've considered just deleting the .git file(directory?) but that seems wrong, but of course what I am doing is also a terrible practice in and of itself so maybe that really is the bet route?
An interactive rebasde would allow you to review each commit message and change the ones you want:
git rebase --root -i
Or, as suggested, you can simply create a new repo and, using the --work-tree option, add everything from your old repo:
git init newrepo
cd newrepo
git --work-tree=/path/to/old/repo add .
git commit -m "Import old repo"
git push -u origin master
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With