When I make changes to a file in Git, how can I commit only some of the changes?
For example, how could I commit only 15 lines out of 30 lines that have been changed
Worth noting that to use git add --patch for a new file you need to first add the file to index with git add --intent-to-add:
git add --patch
git add --intent-to-add
git add -N file git add -p file