3 ms·
Over the years I've developed two strategies for working with git that have helped me quite a bit: 1) Don't introduce git right away. In the early stages of a
by edavis 9y ago
Over the years I've developed two strategies for working with git that have helped me quite a bit:
1) Don't introduce git right away. In the early stages of a project, at least for me, I'm usually making major changes across multiple files. The commits during this time have relatively little value for me. Only once the basic structure has stabilized do I run "git init".
2) The git index is your friend. Always be incrementally updating the index in preparation for a commit. For example, as soon as a new feature has been written or a bug fixed I'll immediately add the changes to the index. Then I'll go back through and look for ways to "clean up" whatever changes I made and then add those changes to the index. Finally, right before committing I'll run "git diff --cached" and ensure each changed line is the smallest possible change necessary to achieve what I was going for.