I have run gitlabhq rails server on virtual machine, following 1-6 steps from this tutorial https://github.com/gitlabhq/gitlab-recipes/blob/master/install/centos/README.md a
I stumbled across the same error using BitBucket. I had a local Git repo I wanted to back up online, so I created a new repository from my BitBucket account (using the web interface).
After running git remote add origin git@bitbucket.org:StatMarianne/.git, I ran git push origin master to no avail (I typically don't use the -u option with git push because I don't mind typing up the full repo and branch names when pushing and pulling).
The error read:
remote: You're not allowed to write to this repository.
To bitbucket.org:StatMarianne/.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@bitbucket.org:StatMarianne/.git'
But my local branch did get successfully pushed when I ran git push -u origin master (following strictly BitBucket's instructions).
I find it surprising, since -u (--set-upstream) should only "add upstream (tracking) reference..." Anyhow.