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

How to copy commit history from one repo to another?

olivier July 11, 2020

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
Atlassian Team members are employees working across the company in a wide variety of roles.
July 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
AUG Leaders

Atlassian Community Events