remote error associated to absorb the first push rejected

F:\abb-iot\DmsAPI\DmsAPI (master -> origin)
λ  git push --set-upstream github master
To github.com:G****c/DmsAPI.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to '[email protected]:Glorycsc/DmsAPI.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

  

 

If there is pull into this error:
fatal: refusing to Merge UNRELATED Histories

  This error is due to local and remote warehouse has a different starting point, that is, no two warehouses unable to submit a common commit arise. Here we need to use --allow-unrelated-histories. Our pull is replaced by the following command like this:

git pull origin master --allow-unrelated-histories

If you set the default branch, you can write:

git pull --allow-unrelated-histories

Guess you like

Origin www.cnblogs.com/gloryhope/p/12067853.html