M
M
mkone1122020-09-27 02:14:56
git
mkone112, 2020-09-27 02:14:56

How to make comments in code just for yourself?

How can I write comments in the code so that they do not get into the repository? An example of a situation: I’m a junior / trainee, I come to my first project, I get a certain task, I pull together a repository and try to figure it out somehow and, of course, I write comments explaining the work of certain pieces of code. Then I complete the task and push back to the repository. How can I prevent my "code notes" from getting into master?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey delphinpro, 2020-10-03
@mkone112

I want - I index entire blocks, but I want - only selected lines. Atlassin SourceTree.
5f704cd7c4a98090079782.png
Details in the comments above :)

V
Vladislav Lyskov, 2020-09-27
@Vlatqa

There is such a thing, a notebook is called, so you make notes for yourself in it

A
Aetae, 2020-09-27
@Aetae

If later you don’t need these comments yourself, then just start your own git hook (written by you in a language convenient for you), which will overwrite your special comments in the files before sending (for example, by some label).
If needed, then there seemed to be plugins for different ide allowing you to write comments to the file (not in the code), google for your own.
Deleting comments before submitting and pasting them back into the code is not an option, notable hemorrhoids will arise with merges and conflict resolution.
PS In general, just write comments carefully and upload them along with the code. Documentary comments are not superfluous at all.)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question