GitHub version CODEOWNERS file

We have a git repo hosted on GitHub using a successful git branching model .

To protect the leading and dev branches, we have a couple of CODEOWNERS files . PR server requires user A approval and PR for dev requires user A, B or C user approval.

I'm not sure how to handle the versions of the CODEOWNERS files themselves. Ideally, we would like them to remain static, however, initiating PR between dev or master results in merge conflicts due to different CODEOWNERS files.

Is it possible to set the branch history so that master / dev does not try to sync CODEOWNERS files? What commits do I need to do?

I am the repo administrator, so temporarily disable the PR requirements for master / dev.

+4
source share
1 answer

The file CODEOWNERSappears to be a configuration file that has nothing to do with the source code in any of your Git branches. Therefore, I would say, first of all, do not specify the version of Git. One solution to your problem is not the version of this file. You can try removing it from the Git repository and then adding it to the files .gitignore. For the first part, use:

git rm --cached <path/to/CODEOWNERS>

Once you do this, you can add CODEOWNERSin .gitignoreto make sure that no one else can add it (i.e. check it out) later.

0
source

Source: https://habr.com/ru/post/1685390/


All Articles