The error possibly comes because of the different structure of the code that u are committing and that present on GitHub. It creates conflicts which can be solved by
Merge conflicts resolving:
If you confirm that your new code is all fine you can use:
git push -f origin master
Where -f stands for “force commit”.