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

时间:2015-11-08 23:36:29

标签: git bitbucket

我在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版本

2 个答案:

答案 0 :(得分:1)

你确定你没有错过-u的破折号吗?我的提示提供了使用u代替-u时出现的确切错误。另外,请确保已将Bitbucket远程文件origin正确添加到本地存储库。

答案 1 :(得分:1)

当我意外地尝试推送一个没有任何提交的repo(用git init初始化,链接到其远程git remote add origin ...)时,我遇到了同样的错误。首先尝试添加初始提交,然后重试。

相关问题