title: Git and testing code changes without automated testing
body: <p>I am creating a game, and I have it in a git repo. I want to develop a new graphical feature, and that is hard to unit-test without actually seeing on screen what is being produced. That's why I can not test it automatically. And that also produces a problem when managing what ends up in the master branch.</p>
  
  <p>I am wondering, how should I create the testing code that it does not overlap with the code in master. I want to keep the master code as clean as possible, and that means it should not contain at all, or very little testing code. And then when I'm creating the feature, I have to write loads of code to test it out. </p>
  
  <p>How do I manage the code so that absolute minimum of the testing code ends up in master after merge? Is there something similar to gitignore which ignores certain pieces of the code that is already in the feature creation branch when migrating to master?</p>
  
  <p>I know I can remove the testing code after the feature is done, but what if there's a bug and I need the testing code again? It would be great to have it stored just in case in the feature development branch.</p>
  
  <p>I also know that I can use two branches (actually the idea came up while writing this question). One for the feature and one for testing the feature. That brings up a new problem. If I need to make small changes, I would have to hop back and forth in the branches and merge awfully lot. That all is away from my time debugging/creating the feature. </p>
  
  <p>I want to be as lazy as possible while being as productive as possible. How would I achieve this?</p>