What should you do before pushing again?
$ git push ! [rejected] main -> main (fetch first) hint: Updates were rejected because the remote contains work that you do not hint: have locally.
- Integrate remote work with
git pull - Retry the same push with
--force - Delete the local repo and clone it again
- Run
git push -u origin main
Someone else pushed first. Pull (merge or rebase) to include their commits, then push; forcing would overwrite their work.
Play Git ▸