I'm using Github Pages to build my portfolio webpage. I've already built part of the website(it is online) and I get an error every time I try to update it.
The main HTML file for the webpage is named index.html. I am trying to add buttons to the website, so I added the buttons in my index.html file and saved it. Then I perform the following commands in my terminal (In the repository, of course):
git add index.html
git commit -m "Adding buttons"
git push origin master
Then I have to enter my username and password. I get the following error:
To https://mywebsiteurl
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://mywebsiteurl'
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.
How do I solve this error and push the changes to my repo?