When modifying a file in a project, you don’t have to include every changes.
You can select what changes in a file to include or not with Staging Patches
This can be useful to exclude debugging print statement for example.
-p flag along with add:
git add -p [file]
press
?for a list of possibility.
y: to add the hunkn: to not add its: to split it. For each element, you will be prompted for what you want to dogit diff –cached