git push -u origin --all 不再起作用

git push -u origin --all does not work anymore

我已经在 Bitbucket 上创建了一个帐户。根据他们的指示,我必须使用

git push -u origin --all # pushes up the repo and its refs for the first time

但是自从我收到此消息后,它并没有按预期推送 refs :

error: --all can't be combined with refspecs

是否因为 git 改变了,所以他们的说明已经过时了?我以前确实使用过 Bitbucket 我不记得有过这个问题。

如果是,他们应该如何重写它?

更新:我读过 Error when "git push" to github 但这不完全是我的问题。我的问题也是关于 bitbucket 编写的文档:它是否过时了,即它在过去工作过但现在不再工作了,因为 git 改变了它的规范?还是一开始就出错了?

更新:我在 Windows

上使用最新的 git 版本

您确定没有遗漏 -u 中的破折号吗?当我使用 u 而不是 -u 时,我的提示给出了你得到的确切错误。还要确保您已将 Bitbucket 遥控器作为 origin 正确添加到本地存储库。

当我不小心尝试推送一个还没有任何提交的 repo(用 [=10= 初始化,用 git remote add origin ... 链接到它的远程)时,我遇到了同样的错误。先尝试添加初始提交,然后重试。