Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 13 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save mingderwang/94205de855af7c60cafa88564ea6abd7 to your computer and use it in GitHub Desktop.
Save mingderwang/94205de855af7c60cafa88564ea6abd7 to your computer and use it in GitHub Desktop.
hint: Updates were rejected because the remote contains work that you do hint: not have locally. This is usually caused by another repository pushing hint: to the same ref. You may want to first integrate the remote changes hint: (e.g., 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
$ git pull origin master //run this first, then
$ git push origin master
@spxctr00m
Copy link

I used git push -f origin main and it worked for me.

@M1k3ll
Copy link

M1k3ll commented May 1, 2024

use "--force"
"git push -u origin main --force

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment