I would like to modify a test to comment in some extra code:
- /*SimpleMonitor monitor = new SimpleMonitor();
- machine.attachMonitor(monitor);*/
+ SimpleMonitor monitor = new SimpleMonitor();
+ machine.attachMonitor(monitor);
That is, when I am building locally I would like to enable SimpleMonitor, but I always want the checked in code to keep it commented out. SimpleMonitor prints out some verbose information about what is going on internally in my test cases.
Of course I can just never add this change to the commit.
Is there a way with git that I can always exclude this change, even when using 'git add .' or 'git add -A' and so on, such that git will skip over this change?
The idea is that this is a delta that sits on top of a working copy only. If there is some neat trick with stash or using a branch or something else, do please tell me about it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…