Since your local repository is few commits ahead, git tries to merge your remote to your local repo. This can be handled via merge, but in your case, perhaps you are looking for rebase, i.e. add your commit to the top. You can do this with
git rebase
or git pull --rebase
Here is a good article explaining the difference between git pull
& git pull --rebase
.
https://www.derekgourlay.com/blog/git-when-to-merge-vs-when-to-rebase/