9

I created a project on mean stack (mean.io) using

mean init

This created a git repo which I want to push into my own private git repo on Bitbucket. I did:

git remote add origin git@bitbucket.org:my_login/reponame.git
git push -u origin --all

I'm getting the following error

! [remote rejected] master -> master (shallow update not allowed)

Any advice on how I can push my local repo into brand new remote repo on Bitbucket?

Alexey
  • 732
  • 7
  • 18

2 Answers2

12
git fetch --unshallow upstream

Then

git push -u origin --all
Methuz Kaewsai-kao
  • 1,176
  • 2
  • 10
  • 22
  • "git fetch --unshallow upstream" is what I needed but couldn't find in docs. Thank you! – Alexey Apr 28 '15 at 04:00
  • this recipe helps also in case of the following error from bitbucket: ` ! [remote rejected] master -> master (missing necessary objects)` - thank you! – hooke Dec 15 '16 at 02:40
1

On which branch do you want to push the local repo? Try to define every time the remote branch on which you want to push the local repo.

git push -u origin master --all

If it's not working then check this answer:

Remote rejected (shallow update not allowed) after changing Git remote URL

Community
  • 1
  • 1
Endre Simo
  • 11,330
  • 2
  • 40
  • 49