Git Error: refusing to merge unrelated histories [How to Solve]

Reason: the history submission of local warehouse and remote warehouse is different.

Solution: merge the history of the two warehouses -- allow unrelated history

git pull origin master --allow-unrelated-histories

Read More: