GIT——! [rejected] master -> master (non-fast-forward)

● Problem:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'ssh://192.168.137.64:29418/51Selling.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (eg
hint: 'git pull …') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details .A Insert image description here
conflict occurred during project submission. This problem will occur (rejected) after git push origin master, so don’t rush git add after remote add. Be sure to git pull origin master because you are creating a remote library. There is a README file but not locally, causing the local and remote to be out of sync.
● Solution:
1. You can generate a README file locally using
git pull --rebase origin master    
git push origin master
2. Force upload to overwrite remote files (less used, dangerous)
git push -f origin master

おすすめ

転載: blog.csdn.net/m0_47147246/article/details/129670447