Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
Level
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bitbucket pipeline to Heroku fails "Push rejected, source repository is a shallow clone." Edited

I have a pipeline to Heroku app cloud for nodejs based frontend app.

deploy2.jpg

 

Dont know how to fix this...

.yml file looks like this:

# This is a sample build configuration for JavaScript.
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.5.0

pipelines:
default:
- step:
# set HEROKU_API_KEY and HEROKU_APP_NAME environment variables
# set clone `depth: full' as described here: https://confluence.atlassian.com/x/Y9-5Mw
name: Deploy Koneviesti frontend to Heroku
# deployment: test # set to test, staging or production
# trigger: manual # uncomment to have a manual step
script:
- git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master

 

The problem comes from pipeline run:

37s
git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master
<1s
+ git push https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git HEAD:master
remote:
remote: ! Push rejected, source repository is a shallow clone. Unshallow it with `git fetch --all --unshallow` and try pushing again.
remote:
To https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git
! [remote rejected] HEAD -> master (shallow update not allowed)
error: failed to push some refs to 'https://heroku:$HEROKU_API_KEY@git.heroku.com/$HEROKU_APP_NAME.git'

2 answers

Fixed same problem by adding
git filter-branch -- --all
before the git push

It's works!!!!!   

This worked for me as well.

 

Does this line need to stay in the pipeline.yml file or can it be removed? (not sure if it's a one-time fix or if it needs to be there long-term)

I fixed this with clean repository and all worked very nicely.

GIT has goon to the "node" :)

When creating pipelines, remember to have fundamentals right. Then add pipeline setting and needed configurations for both ends. I know now this case, so remember to i.e. email me if have problems with heroku&bitbucket - marko.melko@live.com

Do you have idea what was the problem? I encountered this and don't want to clean the repo

@Marko Melko Can you share your final solution in .yml?

Like Matthew Palmer likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

538 views 6 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you