There’s nothing wrong with doing this before pushing to Github

2-panel meme. Panel 1: Cat, with caption “Code I wrote to make it work.” Panel 2: Same cat, but now wearing a tuxedo, with caption “Code I push to Git.”

I think we all understand that the poster actually means GitHub rather than Git. Personally, I think that cleaning up your code before putting it on Github is a good thing — after all, Harold Abelson put it best:

Programs must be written for people to read, and only incidentally for machines to execute.