Commit reformat/rearrange changes as separate commit

Answered

Is there a way to separate the reformat/rearrange changes that IntelliJ makes on your behalf into a completely separate commit, just so there's no confusion about what your actual commit is intended to affect?

1
4 comments

Hello,

If I understand the request correctly, you can commit without automatic reformating, then reformat the file, and commit again.

But could you please clarify, why does auto reformating during commit make a confusion?

0
Avatar
Permanently deleted user

We're beginning to use this feature on an older codebase and when it's reformatting/rearranging code, those lines get tagged with the new commit message/version, making it seem like it was a necessary change instead of just cleanup.

0

Would it be an option to reformat the whole project first and commit it with the appropriate message and then perform the necessary edits/commits?

0
Avatar
Permanently deleted user

Might not be a bad idea - in fact, I think I'd prefer this - but it might be nice to have the feature that I'm talking about.  Definitely not necessary, but nice.

0

Please sign in to leave a comment.