Possible Duplicate:
How can I commit only part of a file in git
How do I commit a few specific line ranges from a file to git? while ignoring some other line changes in the same file.
Possible Duplicate:
How can I commit only part of a file in git
How do I commit a few specific line ranges from a file to git? while ignoring some other line changes in the same file.
Try git add -p -- it will interactively let you add, skip, or split diff hunks.
git add -p lets you break up the hunk into smaller hunks. See the 'a' option. If that doesn't work then maybe the 'e' option will. See the "Interactive mode" section of kernel.org/pub/software/scm/git/docs/git-add.htmlUse git add -i to stage the lines then commit as normal, or use git-cola.

git gui, as mentioned by this answer of the duplicate question.
git add --patchmight suffice, but for control over precisely which lines are added, here's what worked nicely for me.