3

I have created an account on Bitbucket. According to their instruction, I have to use

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

But it doesn't push refs as expected since I got this message :

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

Is it because git changed and so their instructions are outdated ? I did use Bitbucket in the past I don't remember having this problem.

If yes how should they rewrite it ?

Update : I read Error when "git push" to github but that's not exactly my question. My question is also about the documentation written by bitbucket : is it outdated ie it has worked in the past but it doesn't work any more because git changed its spec ? Or is it an error from the start ?

Update : I use latest git version on Windows

Community
  • 1
  • 1
user310291
  • 36,946
  • 82
  • 271
  • 487

2 Answers2

1

Are you sure you're not missing the dash from -u? My prompt gives the exact error you get when I use u instead of -u. Also make sure you've properly added the Bitbucket remote as origin to the local repository.

ojrask
  • 2,799
  • 1
  • 23
  • 23
  • I did not mistype I copied and paste from their instructions so the weirdness. Maybe you did not use latest git version on Windows like me ? – user310291 Nov 09 '15 at 09:13
  • I'm running Git 2+ on Linux Ubuntu so it may have some effect. With copy-paste you mean Ctrl-C+Ctrl-V? Some browsers like to insert hidden characters to copied text strings which may or may not appear when pasting to other programs. Did you also copy the comment part which starts with `#`? – ojrask Nov 09 '15 at 09:55
1

I encountered the same error once when I accidentally tried to push up a repo (initialized with git init, linked to its remote with git remote add origin ...) that did not have any commits yet. Try adding an initial commit first, and try again.

marcvangend
  • 5,592
  • 4
  • 22
  • 32