Retaining history from old repos

We are looking at using Stash to help us cleanup our repositories and are wondering if it possible to save the history in this situation

Current situation

13 seperate repos with history, branches, etc

We want to combine this into 1 repo with the old repos as folders under it and use Stash to make a project with this new single repo. Our question is there a way to retain the old history, branch info from the old repos in this new repo or do we lose it all?

1 answer

1 accepted

Hi Devin,

You most certainly can keep your history. This is really a Git question, nothing related to Stash (might help your Googling).

My advice would be to look at git subtree. It allows you extract (and combine) subfolders to/from a repository.

git subtree add --prefix sub/dir/path https://your/repo.git master

You could also use something like git filter-branch to rewrite the history, but that might be a little more advanced.



Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
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...

1,745 views 1 5
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