Me and my friends develop an app together. And the thing is some of the guys has a really bad coding habit - writing stupid log messages. Like "oh sh%t! we got an db connection error here!" or "access denied. f*#k you". Of course we fix it later. But we don't want other people to think that we all code like this. I'd like to hide this guy's commits from history of changes. So after we fixed his log messages other people won't see
"oh sh%t! we got an db connection error here!"
changed to
"db connection error"
Is it any possible way to keep the commit but hide the code changes?
CodePudding user response:
I don't think it is possible while keeping the rest of the history.
The other way is to hard reset your branch to that particular point in the tree, assuming that everything below is good and clean and then make a new commit and then do a force push. This is not a recommended way of doing it and is a bad practise.
That being said, I would say, it is ok to have this in the history as it shows how you have improved as a coder and don't think about how people are going to judge you.