I can't push my files to Github. Error:
Pushing to https://github.com/Brogolem35/project.git
To https://github.com/Brogolem35/project.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/Brogolem35/project.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.
I don't know how to fix it. I tried Git Bash too. It gives me the same problem.
You either:
git pull ...
, try to merge and solve the conflicts if any, then you will be able to git push
ORgit push -f ...
. But be careful about this one, you should use this only if you rebased your local repository and wants to push to a non-public branch.The first one is the safest option if you are not sure what to do.