Git Integration - Is there a way commit single line of code from a multi-line diff change.

Answered

I have the following diff  in code, which represents two separate changes:

  • comment out two existing unused methods
  • Add a new method. 

I want to be able to include these separately into two commits.  If I highlight only the one line adding the new method, and select "Include Only These Lines Into Commit", I expect that ONLY the highlighted line is included.  Instead, the entire chunk is included.  I'm guessing this is just the way it works. 

Is there any way to accomplish what I am asking?  Thanks. 

 

2 comments
Comment actions Permalink

Currently it is not possible
Please feel free to vote for a similar feature request:
https://youtrack.jetbrains.com/issue/IDEA-186988/Allow-commiting-only-specific-lines

0
Comment actions Permalink

Thank you. Voted. 

0

Please sign in to leave a comment.