If another person has pushed to the same branch as you, Git won't be able to push your changes:
$ git push origin main
> To https://HOSTNAME/USERNAME/REPOSITORY.git
> ! [rejected] main -> main (non-fast-forward)
> error: failed to push some refs to 'https://HOSTNAME/USERNAME/REPOSITORY.git'
> To prevent you from losing history, non-fast-forward updates were rejected
> Merge the remote changes (e.g. 'git pull') before pushing again. See the