Your branch is ahead of 'origin/master' by 1 commit

如果当你写完代码准备提交时候,提示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 最近一次提交状态

然后 重新修改要提交代码

然后正常步骤提交就好啦