Problem Description.
Updates were rejected because the tip of your current branch is behind
Scenario.
Create a project on github or coding, then git init locally
and then no git pull -f –all
The readme file in the github version conflicts with the local version, and the reason for the conflict is 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.
Workaround:
Check the box to force overwrite existing branches (changes may be lost), then click upload, and the upload succeeds.
[master][~/Downloads/ios] git push -u origin master -f
Translated with www.DeepL.com/Translator (free version)
Similar Posts:
- Git push Updates were rejected because the tip of your current branch is behind
- How to Solve Error: failed to push some refs to git
- Git Push hint: Updates were rejected because the remote contains work that you do hint: not have …
- Git | fatal: refusing to merge unrelated histories [How to Solve]
- Git Pull Error: Please specify which branch you want to merge with.
- [Solved] Git pull fatal: refusing to merge unrelated histories
- error: src refspec master does not match any [How to Solve]
- How to Solve error: failed to push some refs to ‘xxxx’
- Git Push Error: rejected error: failed to push some refs to… [How to Solve]