简体   繁体   中英

Git Gui I can't push to Github

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:

  1. Do git pull ... , try to merge and solve the conflicts if any, then you will be able to git push OR
  2. Do git 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.

The original poster asked about doing it in Git GUI. I had the same problem and resolved it by using Merge menu option在此处输入图像描述

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM