I just create a new repo on github, I set it with command git remote add origin htpps://XXX
And when I try to push ... with git push origin main ... I have an error :
Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing to the same ref. You may want to first integrate the remote changes (e.g., 'git pull ...') before pushing again. See the 'Note about fast-forwards' in 'git push --help' for details.
It is a new repo, doesn't make senseā¦
I try to push my first things in a new remote repo.
That error means that the repository already contains code.
To make sure your repository is the one you added, use:
If it's correct and you already have code you want to replace Github won't let you upload your code because there is already code and your commit would break the repository version line.
With
--forceyou can ignore this warning and upload your code anyway.git push origin main --force.