Github “Updates were rejected because the remote contains work that you do not have locally.”

I created a new repo, cloned it, added files to the directory, added them with add -A, committed changes, and when I try to push using git push <repo name> master I get:

hint: 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 merge the remote changes (e.g.,
hint: ‘git pull’) before pushing again.

This doesn’t seem to make sense since it’s a new repo and contains only a readme file.

9 Answers
9

Leave a Comment