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: (eg, '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.
Please read the message:
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.
Before you can push your changes you have to pull the remote changes.
i had the same problem .
i used
git push origin master --force
it worked perfect.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.