My situation is the following. I've had a git repository set up for me by someone else, and I'm tasked with pushing to the main branch. I started a local React project on a master branch, and I want to push my code to the remote main branch. Here's what I've already done:
git remote add origin <url>
git remote -v
git push origin master:main
I got the following error
! [rejected] master->main (non-fast-forward)
error: failed to push some refs to '<url>'
Whenever I try to run
git push origin main
I get
Everything up-to-date
However, when I check the github repo, none of the changes have been pushed to the main branch. I have no idea how to push the changes and I don't want to do anything irrational on my own. Any help is greatly appreciated.