46 ms·
You can also commit specific lines using `git add -p`
by tuxracer 11y ago
You can also commit specific lines using `git add -p`
- pimlottc 11y agoAdding 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
- EvanPlaice 11y agoIt'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.
- icebraining 11y agoYou can see all the files and drill down with "git add -i". Git also highlights whitespace problems.
- pimlottc 11y agoI 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.