Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can git ignore specific commented debug code? [duplicate]

As a front end developer, I frequently add code to hide backend devs' error messages ;)

Is there a way of getting git to ignore code commented in a certain way? eg

.error { display:none; } // DEBUG-GIT-PLEASE-IGNORE

Or has someone written a plugin for this?

like image 851
Jake Rayson Avatar asked Sep 05 '25 17:09

Jake Rayson


1 Answers

You can create a clean filter, which drops all lines containing DEBUG-GIT-PLEASE-IGNORE.

But a more clean way is to change the web application, so that this behavior can be configured on the web host.

like image 104
Rudi Avatar answered Sep 07 '25 16:09

Rudi