3 ms·
> Why would you want to add things piece by piece and not commit them? It provides useful checkpointing, so in practice I find that there are lots of things th
by dietrichepp 10y ago
> Why would you want to add things piece by piece and not commit them?
It provides useful checkpointing, so in practice I find that there are lots of things that I will add to the index even though I am going to keep working on them. Committing these intermediate changes is annoying because it just creates extra work when I make the final (squashed) commit.
This strikes me as one of those disagreements that simplifies to, "That's not how I do things, that's horrible."
The other half to this is that commonly, during an interactive commit (git add -p or hg commit --interactive), I realize that I missed some small change. Being able to persist that state means I can add the small change without redoing the interactive commit.
- Too 10y agoSurely some experienced people would want to do it this way and im not against providing an option to do so. The problem is that it's required and the names of the commands are totally misleading for beginners. "add" sounds like something you do the first time you add a file to the repository, not something you have to do every time you modify it. Don't even get me started on umstaging files: git reset which sounds like an extremely dangerous operation when all it does is unstage files, except if you pass it some flags then you can really loose data.