Github says I can assign different code owners for different branch.
but how?
Is there any way for having different file for different branch without any conflict on merging??
please let me know how I can do it.
Each CODEOWNERS file assigns the code owners for a single branch in the repository. Thus, you can assign different code owners for different branches, such as @octo-org/codeowners-team for a code base on the default branch and @octocat for a GitHub Pages site on the gh-pages branch.
Exactly that — by having different files in different branches.
Well, no. But you can configure your local repository to work around the conflicts.
First, you can use builtin merge driver "ours"; see https://stackoverflow.com/a/59503455/7976758 found in https://stackoverflow.com/search?q=%5Bgit%5D+exclude+file+merge
This doesn't completely exclude the file from merge but lower the frequency of conflicts. If you want to completely exclude it and always update it manually you can do
after merge. You can try to automate this in a
post-merge
hook. Something like