Commit specific lines of a file to git [duplicate]

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.


Use git add -i to stage the lines then commit as normal, or use git-cola until you get used to the command line.

Staging lines of a file