Is there a way to force (atleast warn) git commits for a given branch to update only a part of the repo?
For instance, assume I am working on docs on a special update-docs branch, and would like to make sure I don't commit some changes I made to another part of the code by mistake. I would like git to reject the commit or at least warn me that there's a change to a file outside the scope of the docs folder...
Is there a way to achieve this?