I'm using git and been working heavily on my local repository the last week.
I like to make many small commits (like 2 o 3 files) instead of big ones, but this time between time pressure and that the change involved many files, I've got a whole lot of files unstaged.
My question is, what is the best practice in this scenario? Is there any tool that lets me divide the work in small commits?
Note that I do know how to stage files one at a time and make the small commits by hand, but I'm afraid to make a mistake and create a commit that leaves the code in an inconsistent state (like not compiling or working badly).
Thanks!
git add -i
should help you divide commits to chunks, then git stash
rest of code, check if everything works, git commit
, git stash pop
and loop.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With