To gitee.com:xuankb/name.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'gitee.com:xuankb/name.git'
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分支落后于远程仓库的master分支.
这通常发生在远程仓库有新的提交,而你的本地仓库还没有这些更新.
简单来说, 就是 远程仓库有的东西, 你本地仓库没有.
这时候, 你把本地仓库的代码, 推送到远程仓库, 就会爆出这个错误.
这个问题的解决思路就是, 把远程仓库的代码, 先拉取到本地仓库, 然后再进行提交.
以下是我解决该问题的步骤:
1.git fetch origin
该命令的作用是, 从远程仓库获取最新的代码内容.
但是, 它只是获取信息,