I recently found out about git add’s interactive mode.
Yes, it allows you to add/revert files in/out of the index without typing the filenames … but, more importantly, it allows you to add only certain lines of a file rather than the whole thing.
Just watch GitCast #3 (4:24) and see how useful it can be.
This is the kind of stuff I used to do manually at commit time. Developing a feature is not always a linear process, but I still want my commits to be cohesive (an idea developed in the atomic coding screencast).
Ending up with messy commits is easy. This is especially true for my config files: I usually make changes and give them a few days before committing them. If I make other changes in the config files (while I’m hanging around there anyway), the result is a bunch of unrelated config changes.
I used to use git add -i, but now I use git add -p. Most of the time, that’s all I’m interested in.
I’m still a beginner Git user; I use Darcs for everything (and port my darcs repos to git repos for Github). Darcs not only defaults to an interactive mode when recording, but the entire UI is designed around that kind of interactivity. It’s really wonderful.
Have you tried Darcs? I’m curious to learn, if you have, how you think darcs and git compare.
I’ve been on CVS, SVN, P4, Mercurial and Git … but not Darcs. Nothing against Darcs … it’s more about traction than anything else.
For example, if surrounded by thugs, he’ll gain superhuman strength and durability, allowing him to defeat them. ,