Group Commits With the git reset Command
Learn to group multiple commits into one commit by using git reset.
We'll cover the following...
The git reset
command
The git reset
command removes the commits and puts the changes in either the staged area (with the --soft
flag) or in the unstaged area (without the --soft
flag).
Group multiple commits
If we reset multiple commits, the changes in these commits are grouped. We can then commit again including all these changes in one commit. In this way, we can group multiple commits into one commit.
Usefulness of grouping commits
This technique is useful when we have multiple commits that serve a single purpose. This may happen when we create a commit and then find minor issues to fix until we deliver the implementation. We may need additional ...