Is there a way to exclude lines from VCS commit?
Hi.
I have recently bought GoLand and looking for a way to exclude some comment lines maybe starting with a prefix like `SECRET-*:`.
I have seen such option in no IDEs but perhaps GoLand has it, as it's well-equipped.
Please sign in to leave a comment.
Hi,
Starting from 2018.1 version IDE allows manually choosing what lines you want to commit. Automatic selection (e.g. by pattern) of what should be committed is not implemented. The scenario itself looks quite strange to me. Storing sensitive data in code comments looks dangerous and I believe IDE should not encourage you to do it by adding such feature.
I would love having some option like this
So I could leave some draft or personal TODO brainstorming in comments or my branch while committing to public or master it would stay out of it.
something like # MYTODO or something
Because for me leaving brainstorming tasks\ideas inside the code comments is helpful while its just noise to others
Hello @Froman3,
Please, try the third-party plugin "Code comments". You can comment a code just for yourself inside the IDE without changing the comments of a project itself.
I hope it helps.
I completely agree with Froman3 examples. And I would like to add another one. I'm usually add some debugging output during the work and It would be very cool to ignore those console.log statements from my commits. It would be cool to reject all the changes in lines that were wrapped with some special code regions. Like that:
Ah I see now how can I achieve this using the change lists functionality. We need to simply create a new change list like Debugging and then move all the lines to it. To move the line to this change list you can click on the bar on the left side of the code editor and select the change list using a dropdown.
Dmitriy Davydov Are you using a plugin of some sort? I only have my 4 icons in my IDE.