Sometimes you need to make small changes across many different files. Before you know it, you’re working on something else without committing those changes.
The good practice would be to keep each commit related to a single feature or fix, but often it’s not the case.
Consider the current directory structure:
Imagine that you made a bunch of changes across many files inside of each component. That might include controllers, services, styles, views, etc. At some point, you need to either stash your changes or commit something incomplete.
My quick approach is to use a simple commit message for each module. Using a for loop to iterate over each file or folder, you can commit the changes with a reference to the component.
The end result would be something like:
Please note that this is a quick solution. You should keep your commits related to one fix or feature as much as possible.
For more information on that, check out git flow for a more streamlined branching model.