3 ms·
One of the more challenging parts of git for people to understand is that many of its tools and concepts serve many purposes. Commits are a good example of this
by globular-toast 5y ago
One of the more challenging parts of git for people to understand is that many of its tools and concepts serve many purposes. Commits are a good example of this. To git, a commit is a very simple and precisely defined thing. But what they represent is basically up to you.
One thing they could represent is your current work as of this minute. This is really useful to you while you're working in case you break something and need to revert. But it has very little use to anyone else. Nobody needs or wants to know the history of a project down to the minute. How long it took you to develop a feature and how many times you messed up is completely irrelevant to the project a week from now. So these commits should remain private.
Another thing they could represent is versions. What's a version? It's a fully valid and working copy of the project that anyone could use. These are the commits that should end up on the master branch. Sometimes it's possible to write these first time (for bug fixes or trivial stuff), but most of the time they need to be curated and constructed from the work done using the previous type of commit.
If history is worth keeping, it's worth maintaining. If you don't think it's worth, delete your history.