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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,552,588
Community Members
 
Community Events
184
Community Groups

Copy repository into another project

In Bitbucket Server, I know there's a way to move repos from one project to another existing project. But is there a way to copy the repo to another existing project? It would preserve the old repo while making newer changes to the copy. 

4 answers

1 accepted

6 votes
Answer accepted
Felix
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 09, 2017

You could just fork the repository into another project. See Using forks in Bitbucket Server

Thank you. This seems to be the easiest way to copy a repo to another project. 

Like # people like this
4 votes
Kristy
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Feb 09, 2017

Hi @Kevin Thomas,

As of Bitbucket Server 4.9, we provide a repository import feature. You could use this to copy one repository into another project.

See https://confluence.atlassian.com/bitbucketserver/importing-code-from-an-existing-project-776640909.html#Importingcodefromanexistingproject-Importcodeusingthewebinterface for more details

Hope this is what you're looking for,

Kristy

Thanks, I've tried doing this already. It works, but it takes some time to import.

I choose 'Git' as my 'Import from' option and give it the link to the repo I want to clone. I would think there should be a way to 'import from another project' but I realize that's what forking is for. 

Thanks for the tip, though!

Like Rob Sked likes this

does this also work for cloud version?

Is the "Import from" option still available?

I don't see an "Import from" option in anything accessible from my bitbucket.org web interface.

I've looked in all the tabs and gears I can find.

I need to do some major surgery on the `master` branch of one of my repos, and I would very much prefer to work on a copy -- with full commit history of all the branches -- of the repo in question.

Please advise!

Yes, try "Create Repository", then you should see "Import repository" on top right as a link.

2 votes
Johannes Kilian
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.
Feb 09, 2017

The easiest way:

  • Clone your repository to your local machine
  • Create a new repository on Bitbucket (within your desired project)
  • Setup the new Bitbucket-repository as a remote repository within your local repository
  • Push the local repository to the new repository ....

That's it - or did I misunderstood your question?

I'm aware of this method and it's what I was going to do but I consider it the "brute force" method smile. I'm going to do it this way if I can't find a simpler way to do it through the GUI.

Problem is, we have about 30 repos in one project. We're recompiling them to a newer framework and keeping track of them in a new project. If there's an easy way to do it through the interface itself, I'd rather do that. 

"Why don't you just recompile them and push them back to the original repositories, maybe tag the commits or create a branch?" I wish I made the rules...but our team wants access to both sets of code.

Like # people like this
1 vote
adammarkham
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.
Feb 09, 2017

Hi Kevin,

You can do this using ScriptRunner for Bitbucket Server. Once installed you can go to Admin -> ScriptRunner -> Built-in scripts -> Clone a repository.

This will clone an existing repository to any project you choose. You can see the documentation here.

Let us know how you get on with that or if you need further help.

Thanks,
Adam 

This seems like a useful tool, but I was hoping to find a free, built-in way to do this. Thanks for the tip!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events