3 ms·
> because you commit a state of the repo that (probably) never existed The state doesn't exist in the repository until the code has been committed - so your s
by msarchet 10y ago
> because you commit a state of the repo that (probably) never existed
The state doesn't exist in the repository until the code has been committed - so your statement is a little backwards. Sure the code might never have only had that edit in it, but the repository has no changes until a commit is made.
- dwaltrip 10y agoWhat the commenter means is that one might accidentally select some invalid or non-sensical set of partial changes (that won't compile or run) in an effort to create a logical progression between state A, "no feature", and state B, "feature is complete". If a bug is found, the invalid state of the intermediate commits might make it harder to isolate the change that caused the bug. That being said, I generally use "git add -p". I've gotten accustomed to trying to have clean commits. Although, sometimes the changes have enough complexity that breaking them up becomes too painful and I end up with a few messy commits. Such is life.
- deleted 10y ago[deleted]