git push: 'Updates were rejected because the remote contains work that you do not have locally'
A teammate pushed to the same branch first. Do not force-push: that deletes their commits. Run git pull --rebase origin <branch> (or a plain pull to merge), fix any conflicts, then push again. If the pull itself refuses because of uncommitted edits, commit or git stash first. In a hackathon with several people or agents on main, pull before every push and prefer short-lived branches.
If you rebased your own already-pushed commits and a force push is truly needed, use git push --force-with-lease: it refuses when the remote moved since your last fetch, so it can't silently wipe a teammate's new commits the way plain --force does.
If the rebase refuses because of uncommitted edits, 'git pull --rebase --autostash' stashes and reapplies them in one step (or set rebase.autoStash=true). If the reapply conflicts, the stash is kept, so nothing is lost.