Just to give you guys some context, I've created a new repo on Github. and made an empty repo using git init
but did not clone Github's repo.
Moving on, there wasn't an origin
remote so I created a new remote like so git remote add new-remote <ssh link for Github's repo>
and pushed a few files to it using git push new remote
but I always get this error....
! [rejected] main -> main (fetch first)
error: failed to push some refs to 'github.com:mohaCodes/test.git' 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.