I generally disagree with the best answer and some comments. Neither commits nor push has to be responsible for the quality of the code.
In the svn age, everyone works in the same branch. Failure in your code soon propagates to others. In this case, you definitely have to guarantee your quality of code, and that is the reason why svn is being replaced by git in many companies and organizations.
We need to make clear what is a typical Git workflow. Suppose your master branch has a somehow workable version of the software. Some people prefer to use the master branch as release branch, while others use it as the development branch. It does not matter. Whenever you need to add a feature or fix a bug, you create a branch from the master (or another) branch. The feature should be small enough to be handled without involving extensive modification to the codebase. In case of large modification, layers of branches should be created, so that the last layer of the branch is small enough.
If each branch is to add a small feature, it is not very likely to have many people working in the same branch. If more than one people working on one feature, that group should be very small and communicate very often, and hence, conflict should be easily fixed. If one commit or a push has a problem, only you or your small team will have a problem.
Then where we should guarantee the quality of the code. My answer is the pull requests. In Github, you modify the code and submit a pull request. By the time you submit the pull request, you need to guarantee that your code can compile and pass the tests. In Gitlab, you create a merge request before you modify the code, but mark with WIP (work in progress). Then you modify the code. Before you remove the WIP mark, you need to guarantee that your code is of good quality. Also, the code reviewer will be another layer of protection.
Conflicts should rarely happen in your branch, but it can happen when you merge your branch to the base branch. You should fix it right before that merge happens.
The only thing is related to rebase. Many developers like to rebase their branch before submitting a merge conflict to make the git commit history looks better. If you pushed to the remote and others used your code, rebase causes nasty problems to fix. However, if you always work on a branch that only fixes a small feature, no one should want to use your branch anyway. Also, I personally do not really like rebasing as it modifies the history.
So my conclusion is similar to others, commit often and push often, but for a different reason.