Problem Description:
Updates were rejected because the tip of your current branch is behind
scene:
Create a project on github or coding, then git init locally
then no git pull -f --all
As a result, there is a conflict between the readme file and the local version in the version on github. The reasons for the conflict are given below:
[master][~/Downloads/ios] git push -u origin master
Username for 'https://github.com': shiren1118
Password for 'https://[email protected]':
To https://github.com/shiren1118/iOS_code_agile.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/shiren1118/iOS_code_agile.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
View most of the information, only this one is useful
http://www.cnblogs.com/xwdreamer/archive/2012/05/29/2523958.html
Check Force overwrite existing branches (changes may be lost), and then click Upload to upload successfully.
Only this sentence is the core, so I thought about it a little bit.
[master][~/Downloads/ios] git push -u origin master -f
Original address: https://blog.csdn.net/shiren1118/article/details/7761203