Add git project to existing repository in Bitbucket

I have a project exported from Visual Source Safe to git with an external tool.
Now I want to import this project exported to a Bitbucket repository already used and I want to keep the history of both...

How do I do?

Thanks! Ruggero 

1 answer

0 vote

Do you really want to mix 2 independent software projects with separate history in a single git repository?

If you insist, then you add the second repo as a remote to the first (do all this locally):

$ git remote add repo2 /path/to/repo2

Then fetch its commits into the current repo:

$ git fetch repo2

And then create a branch for repo2's master in the current repo:

$ git branch master-repo2 foo/master

Note that if repo2 contains multiple branches and you want to retain all of them, you will have to make sure none of them clash with the branches of the current repo and invent new names where they do (like master).

Now it it entirely possible I misunderstood your question, as doing this is very unusual, so just let me know.

Suggest an answer

Log in or Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

701 views 0 4
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot