GitHub code merge corrupted both master and branch

This happened multiple times now, I hope this is the right place to ask this question, desperately need help.
We merged the code from a branch to master in GitHub, the merge show conflicts, so we use GitHub to solve the conflicts, after solving all the conflicts, we committed the merge, on the master it show 61 files changes, but on the branch it also show 21 files changed. So here are the questions:

  1. Git supposedly provide the easy merge process, but most of the conflicts are spaces, even newly added lines Git doesnt know what to do, ended up solving a lot basic code changes (in this case there were 30 conflicts), this is causing unnecessary human interactions (compare to ClearCase merge, Git is much dumber). After solving the conflicts, the program was not able to compile, this may cause by human errors.
  2. But why the merge process even touch the existing-development-completed branch, it show 21 files got changed, mostly changes are adding empty lines (there is one file it totally replace the whole file with exact same content), but we suppose to code freeze on the branch, now we dont even know this branch is still valid unless we have to validate each file changed
  3. Due to compile errors, so we decided to reverse the merge on the master, the 61 files seems back to original, but these 21 files on branch still remain changed, and now we dont know we can merge again or not
    This happen few time already, some other teams stopped using GitHub merge process, I am not sure this only occur in our company or it is observed widely?
    I dont know we should continue using GitHub actually if this basic merge process does not work.
    What is the best practice using GitHub specially when this happened?

Hi @evanyangGIT :wave:

A merge conflict happens when you merge two separate branches that contain different changes on the same locations in the same file and it’s unclear which change should take precedence or whether both should be combined.

This can happen even with line spaces. I recommend that you and your team use some kind of linter or code formatter to make sure your code is more uniform.
Linting is the automated checking of your source code for programmatic and stylistic errors. There will be different programs or extensions depending on your code editor and programming language.

If I have 2 branches that work by 2 different teams at the same time, than we need to merge the code to combine changes from both teams in both branches. But we all know this is not the ideal set up.
Usually we have a master branch or trunk, and spit out few branches (always from master) for new function on different releases, so after we merged the branch back to the master, which means the code in branch have been tested and ready for deployment, and we will build the program from the master, and the change in this master will be migrated down to other branches that are still been working on (repeat the same when the branch is ready for deployment). So the merge function is very important and should always be the one way merge.
I hope this is the common process for most people, if not than I need to understand what is the best practice. Specially I like to how to config the Git merge as only one way.