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 ?

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top