Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm git commit split code block change

Is there a way in PyCharm/IntelliJ to split a block of code-changes into multiple parts, so I can commit only parts of it and if so, how?

I.e. in the example I can only tick the checkbox on line 222 and get the entire code-block in my changeset. What I'd like is to only add line 223 to the commit, but not line 224.

enter image description here

like image 501
Konstantin Avatar asked Aug 16 '26 02:08

Konstantin


1 Answers

The 2023.2 update of PyCharm introduces this feature (I'm running build #PY-232.8660.197, built on July 26, 2023).

You should be able to include only specific lines within a codeblock from now on:

enter image description here

like image 73
mrapacz Avatar answered Aug 17 '26 20:08

mrapacz