Hacker News new | ask | show | jobs
by daigoba66 4154 days ago
In practice, I never use 'commit -a' or 'git add -A'. I prefer to use 'git gui' to interactively stage files or just specific lines. This way I can be sure of what is being committed.
3 comments

Github's app [1] does much the same thing, but (IMO) with a much nicer interface. And it works with any git repo, not just one with a github remote.

[1] https://mac.github.com/

I actually prefer `git add -i` if I want more fine-grained control like that.
git add -i is a good idea, but the interface is just /atrocious/ - confusing, poorly worded, visually unattractive and hard to read (dark blue text is not very user friendly on a black background).
I guess it's a matter of taste. I would find the context switching between the shell and the GUI more jarring than the usability of `git add -i`. Also, shell colours can be adjusted.

But in the end it's good to have multiple options.

Oh I also prefer CLI, I just tend to use add -p instead.
I use git add --patch

My teammates probably get tired of hearing it, but every time someone erroneously commits some file or line I advocate its use.

Magit in emacs is great for this functionality. It will even add just the selected region of the diff.
I've defaulted to this for some time now, and have no issues with keeping my own smattering of me-specific configuration overrides. Plus, there are a couple other times when being able to work through the patching interface is a handy skill to have.