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
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 https://bitbucket.company.com/scm/company/repo.git
# 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:
To https://bitbucket.company.com/scm/company/repo.git
! [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 'https://bitbucket.company.com/scm/company/repo.git'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ahh, you have an export that's slightly broken. Start from Ana's fix over at https://community.atlassian.com/t5/Bitbucket-questions/Bitbucket-reserved-refs-when-cleaning-up-with-BFG-tool/qaq-p/702969
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to fix it with help from this web post:
https://stackoverflow.com/questions/44106103/how-to-import-gitlab-repository-to-bitbucket-repository
#cd to the .git folder
cd /d/Development/Repositories/repo.git
# Make a bare mirrored clone of the repository
git remote add repo https://bitbucket.company.com/scm/repos/repo.git
# Create the repository in Bitbucket
# Set the push location to your mirror
git push --all repo
git push --tags repo
All is good now!!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.