background

Git pull failed, fatal: refusing to merge suggested histories

 

The root cause

Because two git libraries, one local and one remote, are completely irrelevant, the local has to push to the remote, and the remote feels that the local library is irrelevant, so it can’t merge

 

Solution 1

Git Clone remote repository to the local, put the content to be pushed to the repository, and then commit to the repository, so that it is an update operation

 

Solution 2

Using mandatory commands

git pull origin master –allow-unrelated-historie 

Followed by — Allow-suggested -histories, where two unrelated branches were forced together; This might bring you to an edit page, just ESC and hit: Q! Can be

Git push -u origin master