News for hackers. Stuff that matters.
Re:Understanding Git for real by exploring the .git directory by tuxracer on Sunday February 21, 2016 @12:19AM (#11143416)
You can also commit specific lines using `git add -p`
Re:Understanding Git for real by exploring the .git directory by pimlottc on Sunday February 21, 2016 @12:50AM (#11143479)
Adding on to your helpful comment, you can also get a more concise, gitk-like graph of commits with `git log --graph`. This is my standard alias for viewing history, which also adds colors and tag/branch names:

    lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %C(magenta)(%cn)%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative --left-right
Re:Understanding Git for real by exploring the .git directory by EvanPlaice on Sunday February 21, 2016 @07:09AM (#11144197)
It's much easier when you can see all of the staged/unstaged files and drill down to staging/unstaging individual lines within those files.

It also highlights whitespace nastiness (ie trailing spaces, missing newline at end of file, inconsistent newline chars, etc).

The CLI is the ideal too for a lot of things. Preparing commits is not one of them.

Re:Understanding Git for real by exploring the .git directory by icebraining on Sunday February 21, 2016 @08:21AM (#11144387)
You can see all the files and drill down with "git add -i". Git also highlights whitespace problems.
Re:Understanding Git for real by exploring the .git directory by pimlottc on Tuesday February 23, 2016 @09:48AM (#11159158)
I was excited when I first heard about git add iteractive mode but I find the interface to be quite unintuitive and idiosyncratic. I just stick to using "git add -p" to stage hunks selectively in a much more straightforward manner.

Having said that, I stage all my commits on command line, and generally go to a GUI rarely for certain visualization tasks.