I would like to discuss with you this way about the best way to work with git.
We are currently developing software with three people. For version management we use git. The main branch is our productive branch. In parallel, everyone works separately in his own feature branch. This branch is regularly pushed and may be rebased. When a feature is finished and should be included in our software, it is rebased again and then merged (fast forward).
Now let's assume that a branch has the task to migrate the project from Springboot 2 to SpringBoot 3. To do this, the parent-Version in our pom must updated and then numerous changes must be made, for example
- Adaptation to Jakarta
- make Hibernate adjustments
- replace deprecated functions ...
For each of these steps I create a commit. So here for example I get 4 commits (adjust parent, jakarta, hibernate, deprecated functions).
This makes sense to me to keep track of the steps. But if I look at the intercommits by themselves, they are not executable.
I could now merge (squash) the corresponding commits before the merge with the main branch, but then I lose my clean subdivision.
Is it a bad practice to merge these individual commits into the main branch or is it ok, since only the entirety is pushed and the last commit restores a runnable state?
I am very much looking forward to your experiences, assessments and feedback.