问题描述
我是该远程git存储库的唯一用户。而且我只能在一台机器上工作。
我避免使用git命令行,并在vscode中执行“全部提交”和“推送”。 没有其他与git的交互。
现在我仍然明白了。我怀疑由于网络故障而出了问题。 但是由于我的git fu非常弱,所以我很犹豫在这里测试建议的操作。 (我的意思是某处的数据一定是错误的。)
嗯,这是在Windows 10上。也许那里有一些特殊问题?
然后。我认为vscode非常容易出错(但现在对我来说很舒服)。对我来说,编辑器中的比赛条件存在很大问题。 (使用便宜的笔记本电脑。)所以,如果我拉扯,我将不得不非常仔细地检查所有内容。
我可以安全地做什么?
> git push origin master:master
To bitbucket.org:HIDDEN.git
! [rejected] master -> master (non-fast-forward)
error: Failed to push some refs to 'bitbucket.org:HIDDEN.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
解决方法
使用master分支更新您的本地分支
使用
git rebase origin/master
如果发生任何合并冲突,请解决。如果没有,那么您很幸运:)。
,我可以安全地做什么?
收集更多信息。
要了解发生了什么,请说git fetch
。现在git log origin/master
,还有git log master
,您将看到本地origin/master
没有的master
提交(反映远程)。
从那里,您可以决定要做什么。