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

Your Points Tracker
  • 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
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?
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

How to import old Stash export into Bitbucket

I have an old Stash export that contains a repository along with all of its history.  For some reason I can't get this one repository to import into Bitbucket.  I did successfully do this for 25 other old repos, but this one is simply not cooperating.  I wrote down notes on how I did it for the other 24, but it doesn't work for this one repo.

Can I get the exact steps and commands on how to do this correctly?

Thanks!! Steve Miller

1 answer

0 votes

If you've got 24 done, you already have the "exact steps and commands", and they work.

The question should be "what is different about this one?".  Also, what are the warnings and errors you are seeing?

Well, not so fast!  I did the other repos about 6 months ago and thought my notes were what I used.  I'm not so sure now.


This is what I did:

# Make a bare mirrored clone of the repository
git remote set-url --push origin

# Create the repository in Bitbucket

# Set the push location to your mirror
git push --mirror

When I run these two commands I get this:

Enumerating objects: 861, done.
Counting objects: 100% (861/861), done.
Delta compression using up to 8 threads.
Compressing objects: 100% (240/240), done.
Writing objects: 100% (861/861), 170.18 KiB | 4.15 MiB/s, done.
Total 861 (delta 619), reused 861 (delta 619)
remote: Resolving deltas: 100% (619/619), done.
remote: You are attempting to update refs that are reserved for Bitbucket's pull request functionality. Bitbucket manages these refs automatically, and they may not be updated by users.
remote: Rejected refs:
remote: refs/pull-requests/1/from
remote: refs/pull-requests/1/merge
! [remote rejected] develop -> develop (pre-receive hook declined)
! [remote rejected] feature/companyPROD-1286 -> feature/companyPROD-1286 (pre-receive hook declined)
! [remote rejected] feature/companyPROD-1405 -> feature/companyPROD-1405 (pre-receive hook declined)
! [remote rejected] feature/companyPROD-219 -> feature/companyPROD-219 (pre-receive hook declined)
! [remote rejected] feature/redis -> feature/redis (pre-receive hook declined)
! [remote rejected] feature/upgraderequired -> feature/upgraderequired (pre-receive hook declined)
! [remote rejected] master -> master (pre-receive hook declined)
! [remote rejected] viral-glue -> viral-glue (pre-receive hook declined)
! [remote rejected] refs/pull-requests/1/from -> refs/pull-requests/1/from (pre-receive hook declined)
! [remote rejected] refs/pull-requests/1/merge -> refs/pull-requests/1/merge (pre-receive hook declined)
! [remote rejected] stable-20120130 -> stable-20120130 (pre-receive hook declined)
error: failed to push some refs to ''

Note to add:

I do get something in the import...  One tag with some old files...  Not helpful!

I was able to fix it with help from this web post:

#cd to the .git folder
cd /d/Development/Repositories/repo.git

# Make a bare mirrored clone of the repository
git remote add repo

# Create the repository in Bitbucket

# Set the push location to your mirror
git push --all repo
git push --tags repo

All is good now!!!

Suggest an answer

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

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

366 views 2 10
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