Reputation: 4885
I'm looking for a way to achieve the following workflow:
EDIT: The message would only apply to a single commit. This would enable you to make continuous additions to your upcoming commit message.
Currently, the best solution is to commit on the first change, and then commit --amend on each following change and modify the previous message.
Upvotes: 0
Views: 2705
Reputation: 55908
You can squash multiple small commits into a single one using an interactive rebase. See http://book.git-scm.com/4_interactive_rebasing.html for the description and an example.
Basically, you need to commit your changes one by one into single commits and then pack (or squash) them into a single one once you are finished. As this changes history, it should only be done in your local repository before the commits were pushed.
Upvotes: 2
Reputation: 49148
If you ever need to use git bisect
to track down a bug, you will be glad for small commits.
On the other hand, if the changes really are trivial, like you're running through one per minute, an oft-overlooked solution is simply to keep a GUI window open and add lines to the commit message text area.
Upvotes: 2
Reputation: 72678
Why not change your "step 3" to simply "commit"? The best part of git is that it allows - even ecourages - many small, incremental commits to your local repository.
Upvotes: 4