IDEA push to gitee reports error Push to origin/master was rejected

1. Questions

IDEA reports an error when pushing to gitee:

Push to origin/master was rejected

2. Solutions

You need to pull the files on gitee to the project first, and then perform the push operation:

git pull
git pull origin master
git pull origin master --allow-unrelated-histories
D:\Workspaces\IdeaProjects\gittest>git pull
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (4/4), 1.78 KiB | 12.00 KiB/s, done.
From https://gitee.com/zydeng0710/gittest
 * [new branch] master -> origin/master
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull  

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/ master


D:\Workspaces\IdeaProjects\gittest>git pull origin master
From https://gitee.com/zydeng0710/gittest
 * branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories

D:\Workspaces\IdeaProjects\gittest>git pull origin master --allow-unrelated-histories
From https://gitee.com/zydeng0710/gittest
 * branch master -> FETCH_HEAD
Merge made by the \'ort\' strategy.
 README.en.md | 36 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 README.md | 37 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 2 files changed, 73 insertions( + )
 create mode 100644 README.en.md
 create mode 100644 README.md