Question

I learnt this trick to clean up the commit log. I want to do it but I have a little concern.

My repo is currently forked by a few people and I wonder if It is wise to clean up my own commit log. For example, I don't know if that will affect future pull requests ? Please tell me if it is safe or else what kind of problem should I expect ?

Was it helpful?

Solution

It's probably not the best idea. Rewriting history is fine for your own branches, but it's not wise to rewrite history for branches you've already pushed -- it'll result in duplicate commits for anyone who has already pulled from your repo.

The Git manual has more info about this.

OTHER TIPS

Don't rebase commits that have been shared. If somebody else has already forked your code, they have those commits in their history. If you ever try to merge with those forks, the commits you removed will come back.

Once published, history should remain immutable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top