You and the remote both have new commits
CommonSomeone pushed to the branch while you committed locally, and no pull preference is configured, so Git will not pick a strategy.
Confirm
git fetch && git status -sb
ahead N, behind M at the same time
Fix
- For this pull only: git pull --rebase to put your commits on top (good for unpushed local work), or git pull --no-rebase to merge.
- Set your preference once: git config --global pull.rebase true (rebase) or false (merge), or pull.ff only if you never want Git to combine histories implicitly.
- Resolve any conflicts the merge or rebase reports, then push.
git pull --rebase
Replays your local commits on top of the remote. Use git pull --no-rebase to merge instead.