Commit only part of a file in Git
Asked 07 September, 2021
Viewed 1.7K times
  • 66
Votes

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 in a file?

25 Answer