Git 克隆后推送被拒绝

Git push rejected after cloning

我使用 git clone 从 bitbucket 克隆了一个 repo。我做了一些更改,然后 git commit。 现在我试图推动,但我得到了 Updates were rejected because the remote contains work that you do not have locally.

现在,我确定我的 git clone 和我的 git commit 之间没有任何变化。

我当然可以 git pull 但我害怕失去我所做的所有更改。

我如何检查到底是什么阻止了我的推送?

先进行 git 获取。这将下载任何远程更改,但不会尝试合并。 然后,您可以查看您的分支与 remote= 克隆的分支之间的区别,并决定要做什么。 git 拉会启动合并,顺便说一句,所以你不会在不知不觉中丢失任何东西。