4

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?

4

1 Answer 1

8

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.