为什么我的本地Git存储库领先于远程?

为什么我的本地Git存储库领先于远程?,git,Git,我是Git的新手,所以我提前道歉。当我在本地副本上执行命令“git status”时,它显示我比远程副本提前3次提交。但当我尝试“推git”时,我得到的信息是一切都是最新的。有人能告诉我这里发生了什么事吗 输出: $ git status On branch master Your branch is ahead of 'origin/master' by 3 commits. (use "git push" to publish your local commits) nothing t

我是Git的新手,所以我提前道歉。当我在本地副本上执行命令“git status”时,它显示我比远程副本提前3次提交。但当我尝试“推git”时,我得到的信息是一切都是最新的。有人能告诉我这里发生了什么事吗

输出:

$ git status On branch master
Your branch is ahead of 'origin/master' by 3 commits.
  (use "git push" to publish your local commits)

nothing to commit, working directory clean

你确定它没有告诉你你在遥控器后面吗?B你已经设置了上游远程分支,所以当你做git push的时候,它实际上会尝试去推它应该去的地方?git push origin yourbranch会给您相同的结果吗?尝试使用gitk-all查看历史记录。要获得相关答案,请发布git status、git branch-vv和git-version的完整输出。@Billy:您能发布一些代码吗?也就是说,git状态的输出至少可以帮助诊断。谢谢大家的回复。这是git status的输出:$git status On branch master您的分支比“origin/master”早3次提交。使用git push发布您的本地提交无需提交的工作目录。答案在另一个stackoverflow帖子中给出: