美文网首页
【git 使用】【git常见错误处理一】状态不一致:Your b

【git 使用】【git常见错误处理一】状态不一致:Your b

作者: 高阳刘 | 来源:发表于2020-04-16 17:48 被阅读0次

【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

相关文章

网友评论

      本文标题:【git 使用】【git常见错误处理一】状态不一致:Your b

      本文链接:https://www.haomeiwen.com/subject/hsedvhtx.html