4 ms·
Presumably this is so you don't forget about a bunch of small changes when making a large commit. However, for me, right before I do a commit, I always do a di
by jedberg 11y ago
Presumably this is so you don't forget about a bunch of small changes when making a large commit. However, for me, right before I do a commit, I always do a diff to make sure what I'm about to commit is what I intended to, which has the nice side effect of seeing all the changes and reminding me for the commit message.
Is this not the common way most people commit?
- joncalhoun 11y agoI believe this is a pretty common thing based on personal experience.
- davegauer 11y agoThat's certainly how I do it. I find it very helpful to get a review of my changes, particularly before I begin on the next task.
- tylorr 11y agoAt this stage I also try to split up my changes into multiple commits, avoiding large commits.
- jedberg 11y agoI do that as well, but in my branch. When I merge to master I tend to squash into bigger commits so as not to pollute the timeline so much. If someone really needs to see the small commits they can always look at the branch.
- sootn 11y agoCheckout the -v option :)
- eecks 11y agoThat's how I do it as well. It's a personal code review.
- saurik 11y agoI do a -p and work my way through all of the hunks, pulling out a cohesive "story" of multiple separate commits from the work that I did, sometimes editing hunks as I go to "backport" some changes to fit other parts of the story.
- wingerlang 11y agoI use SourceTree, which has the ability to stage individual lines (I know, git cli can as well). So even if I work on 2-3 things at the same time, it is trivial to select the correct changes for the commit.
- EvanPlaice 11y agoI use git cola for the same. It's a really light weight little tool that's surprisingly feature complete. I usually make a bunch of changes at once. Following a break I review the changes and break them up into logical commits. I aim do break up changes so that the commit log can be read like a book and. I can guarantee that not a single commit contains hidden surprises or unrelated changes. I don't know how most devs get by with just the CLI. A lightweight gui makes commits and reviewing the history tree so much easier.