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

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 copy commit history from one repo to another?

Dear Bitbucket community,

 

I would like to copy the commit history of one repo to another. I have my main repo and I duplicated it and called it my "dev" repo to practice using git. I made some changes to the "dev" repo and would like to move those changes to the main repo. Any tips on how to do that? The manual way to do that would be to make a local clone of the "main" repo and then replace all the files and commit each change manually but it seems very time consuming. I can also replace all files at once and make one huge commit but then I would lose the commit history. How can I update the main repo with the commits I made in the dev repo?

 

Any help would be much appreciated.

Kind regards,
Oli 

1 answer

1 vote
Ana Retamal Atlassian Team Jul 13, 2020

Hi Olivier, welcome to the Community!

First of all, please note that your question tilts towards how to use Git rather than how to use Bitbucket, so you might not always find answers to that kind of questions in this forum. That said I'll try to help you anyway :) 

To bring changes from the second repository to the first one, you can use git pull. You'll do it from your original repository, and the command would look something like:

git pull <path-to-second-repository> <branch-where-the-changes-were-made>

If you made the changes on a remote, the path will be its URL.

You can read more about git pull in the official Git documentation.

Hope that helps!

Ana 

Suggest an answer

Log in or Sign up to answer
TAGS
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...

3,757 views 10 16
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