title: How to prevent git merge or git rebase to change specified files even if there is no confilct?
body: <p>A portion of project code is generated, yet it must be tracked since regenerating this portion requires lots of resources(mostly time). </p>
  
  <p>On master branch, commits are performed when this portion of code is change just to isolate those changes. </p>
  
  <p>On topic branches the same portion of code can be regenerated. </p>
  
  <p>Yet when merging topic branches this portion of code must not be altered by the changes in topic branch, files on master branch must remain untouched.</p>
  
  <p>I have tried to use .gitattribute to set merge=ours strategy yet this is just for when there are conflicts as is stated in documentation.</p>
  
  <p>The merge constraint should be applied without manual intervention. since its easy to forget.</p>