【git 使用】【git常见错误处理一】状态不一致:Your branch is ahead of 'origin/master' by 2 commits
现象:当查看状态时,或者pull拉取server上的版本时,提示本地commit没有push:
【命令】:
# 查看本地状态信息
git status
【报错】:
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
【分析】:
如果保证git server上确实已经提交了代码,仅仅只是本地git状态不一致,则可以用以下命令:
git fetch - -all
git pull
git reset - -hard origin/master
然后查看状态,正确了。
————————————————
原文链接:https://blog.csdn.net/maoyingyong/article/details/104385815
网友评论