How to tell git to ignore individual lines, i.e. gitignore for specific lines of code [duplicate]

.gitignore can ignore whole files, but is there a way to ignore specific lines of code while coding?

I frequently and repeatedly add the same debug lines in a project, only to have to remember to remove them before committing. I’d like to just keep the lines in the code and have git disregard them.

2 Answers
2

Leave a Comment