Home ›
Committing selected changes in files, not all the changes, with git add -pCommitting selected changes in files, not all the changes, with git add -p
Submitted by Benjamin Melançon on October 22, 2010 - 11:56am
For committing just some changes in a file, use
git add -p
y to apply the hunk presented, n for not that hunk, and s to split the hunk smaller – and e to edit manually
It is all explained in the Interactive Mode portion of the git add manpage:
http://www.kernel.org/pub/software/scm/git/docs/git-add.html#_interactive_mode
Searched words:
"git add -p"
git add --patch
git documentation
git-add manual page
Comments
Post new comment