A few tips for any git user.
- Make your master/main branch protected. This will disable any pushes to it and only allows merges.
- During development merge features into a staging/development branch to test functionality.
- When creating a new feature branch of the main/master branch.
- Never develop on the staging/development branch, only fix merge conflicts
This should prevent a lot of issues