News for hackers. Stuff that matters.
Re:GitHub - Shiny new commit styles by chousuke on Tuesday September 06, 2011 @04:26PM (#2967143)
I think the present tense recommendation comes from the expectation that each commit works as a stand-alone patch. Thus the commit message does not describe what changes you did to the repository, but what the patch does to it.

Git provides a wealth of tools to craft perfect commits, and if you use them, it's not difficult to end up with a nice history of "add this, remove that, modify something else" changesets that (usually) would make sense even when separated from the surrounding history.

Re:GitHub - Shiny new commit styles by akkartik on Tuesday September 06, 2011 @04:31PM (#2967165)
"Git provides a wealth of tools to craft perfect commits"

Pointers please?

Re:GitHub - Shiny new commit styles by chousuke on Tuesday September 06, 2011 @04:59PM (#2967274)
Others already mentioned rebasing, but I think the most important tool is the index, or "the staging area". Lots of people not used to Git tend to see the index as an unnecessary extra step, but it's really what enables the good stuff.

In short, the index allows you to decide what goes in a single commit, regardless of the actual contents of a working directory. You can commit only a single line from a file if you want. If you learn how the index works and why it works like it does, understanding the rest becomes much easier.

You can also eg. resolve a conflict piece-by-piece by adding resolved parts to the index, diffing against the working directory, and then finally committing once the content of the index looks correct.

There are many tutorials and I'm not sure which one is the best but I think the book "Pro Git" does a good job at explaining the index among other things. It's freely available online at http://progit.org

Re:GitHub - Shiny new commit styles by akkartik on Tuesday September 06, 2011 @05:02PM (#2967288)
Sorry I read your original as 'crafting perfect commit messages'.
Re:GitHub - Shiny new commit styles by lautis on Tuesday September 06, 2011 @04:42PM (#2967211)
Re:GitHub - Shiny new commit styles by floggit on Tuesday September 06, 2011 @04:43PM (#2967212)
git amend git rebate -i ...