If we want to commit only part of changes of the same file
--patch
or
-p
is used
git add --patch
Similar to the above command
git add -p
Possible answers for the command:
y
stage this hunk for the next commit
n
do not stage this hunk for the next commit
q
quit; do not stage this hunk or any of the remaining hunks
a
stage this hunk and all later hunks in the file
d
do not stage this hunk or any of the later hunks in the file ... The complete list of the possible answers is on the link of the note
by Valeri Tandilashvili
4 years ago
Git
4
Pro tip: use ```triple backticks around text``` to write in code fences