Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

importing source code and history from another server

Gibran Shah September 13, 2016

Hello,

We have a project that's under source control. The repository is a Bonobo server. We would like to transfer the source code along with the entire history over to BitBucket. We can get to the point where we are logged into our BitBucket account and we can create a new project. Now we would like to know: how do we import the project sitting on the Bonobo server along with its history over to our new BitBucket project?

Is there a step by step guide that we can follow?

We can also work in SourceTree if importing from the Bonobo server can be done from there.

2 answers

1 vote
John van der Loo
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 15, 2016

Hi @Gibran Shah,

As of Bitbucket Server 4.9 you can also import repositories using the web interface with our new Repository Importer

0 votes
Rich Duncan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 13, 2016

The git repositories are easily moved - you should be able to find a complete write-up.  We have an automation tool that does this.  What it essentially does when migrating repos from git to git is:

 

git clone --mirror src-repo-spec

git remote add target  target-spec

git push --all target

git push --tags target

 

 

 

 

Gibran Shah September 13, 2016

Thanks Rich,

I get stuck on step #2: git remote add target target-spec:

add to target fails.png

For target-spec, I enter "https://gibran_shah@bitbucket.org/acmriskalive/risk-aliveprodiler-2.git" because that's what the Bitbucket instruction page tells me to do:

bitbucket instructions.png

... except it says to use "origin" instead of "target".

Unfortunately, I get an error: "fatal: Not a git repository (or any of the parent directories): .git".

Rich Duncan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 13, 2016

Once you clone the repo, it will create a directory in the current directory.  You need to cd into that directory before doing the git remote add target

 

-Rich

Gibran Shah September 14, 2016

Thanks Rich,

Once I got that, the rest worked like a charm.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events