git推送报错 Your branch is ahead of 'origin/master' by 1 commit

当出现no changes added to commit (use “git add” and/or “git commit -a”)

git commit之后,用git status,打印信息为:

Your branch is ahead of ‘origin/master’ by 1 commit.

说明没有文件需要commit,但是本地仓库 有一个commit ahead原来的master,就是本地仓库有一个提交,比远程仓库要先进一个commit。git push origin master之后,再用git staus,打印信息为:
On branch master
nothing to commit (working directory clean)

此报错意思为git不知道您当前提交的版本
登录用户并上传

git push origin master
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章