Git推送遇non-fast-forward被拒错误,该如何处理?
Git推送被拒绝(non-fast-forward)解决方案
错误日志
! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://dev.azure.com/TESTAZURESONAR/AzureSonar/_git/AzureSonar' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. If you want to integrate the remote changes, hint: use 'git pull' before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
问题说明
本地master分支的提交进度落后于远程同名分支,Git拒绝推送操作,需先整合远程的最新变更。
解决步骤
执行以下命令拉取远程master分支的最新内容并合并到本地:
git pull origin master
合并完成后重新执行推送命令即可。
内容的提问来源于stack exchange,提问作者Abderrahim belaid
相关产品推荐
相关产品推荐

