如果当你写完代码准备提交时候,提示Your branch is ahead of 'origin/master' by 1 commit,

Your branch is ahead of 'origin/master' by 1 commit说明 你本地仓库和远端仓库信息不一致。

别急,这时候只需要同步到master分支内容和本地提交内容一致就okl

将更改后的代码备份(因为同步过程中master 远端分支的提交旧于当前本地提交,会以远端提交为主)

然后执行: git reset --hard origin/master  本地代码就会更改为master 最近一次提交状态

然后 重新修改要提交代码

然后正常步骤提交就好啦

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-16
  • 2022-12-23
  • 2021-05-25
  • 2021-09-04
  • 2022-12-23
猜你喜欢
  • 2021-06-18
  • 2021-10-04
  • 2022-12-23
  • 2021-11-01
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案