使用git status
时遇到问题。我得到了这个输出:
# On branch master
# Your branch is ahead of 'origin/master' by 1 commit.
#
nothing to commit, working directory clean
首先,提交和推送自述文件(README.md)工作得很好。我该如何解决这个问题?
答案 0 :(得分:2)
你可以通过将它再次推向掌握来解决它:
git push
or, if your master branch wasn't tracking origin/master already
git push -u origin master
(请参阅“追踪”业务“What's the difference between git config
and git push --set-upstream
”和“hat exactly does the “u
” do? “git push -u origin master
” vs “git push origin master
””
git push无法解决这种情况的唯一一次是你需要进行git fetch才能更新本地仓库存储的原始SHA1。
请参阅“git: Your branch is Ahead by X commits
”。