3 ms·
I've seen this kind of thing many times before: the developer wants to commit something (in this case, an import refactor), and accidentally commits other chang
by cesarb 7y ago
I've seen this kind of thing many times before: the developer wants to commit something (in this case, an import refactor), and accidentally commits other changes which were being worked on. This is why I don't recommend getting into the habit of using "git commit -a".
- pilif 7y agoabsolutely. I'm telling people to always use `git add -p` to help them produce self-contained commits. And if you screw something up, there's always `git commit --amend` or the sledgehammer of `git rebase -i`. Note: I'm not advocating doing this to public history, but I'm saying: Use these tools in order to create self-contained changes on your end before committing them to public history. When I'm doing archeology trying to find out why Foo is doing Bar instead of Baz, I don't want to know that back then, 10 years ago, you fixed a typo or added a "forgotten file".