Local repository upload to remote repository error: failed to push some refs to ‘https://hub.fastgit.org/zhizhangxuezhang/ui-test.git‘

There is an error in pushing from the local warehouse to the remote warehouse (rejected) because the code of the remote warehouse has been modified directly in the remote warehouse. At this time, the code of the local warehouse is different from that of the remote warehouse, so you must update the code of the local warehouse (Pull) first and then submit (push)

Error log in idea for this problem:


error log in Git bash:

at this time, you can only pull to update your local warehouse and then push to the remote warehouse, but you will find that you will also report an error when you pull to the local warehouse


at this time, your pull command should be changed to the following command, That is, just add a parameter to ignore the history (because the two branches are caused by different versions)

git pull origin master --allow-unrelated-histories

Read More: