Hi all,
I've been asked a couple times how to migrate some folders (eg bundles) from a Git repository to another, and this preserving the history.
While I don't remember the exact details, here are the steps I've carried on:
* from the *source* Git repo
** Make sure you're on latest master
** check the content of the repo on the filesyste,
** check `git history` for a long time, to ensure that history seems to contain relevant things only and that the history seems complete (basically the 1st commit of legacy history is still visible -with a different hash though- in the filtered history)
** `git push myFork HEAD:refs/heads/filtered-repo`
* From the *target* repo
** Make sure you're on latest master
** `git fetch myForkOfSourceRepo filtered-repo`
** `git merge --allow-unrelated-history FETCH_HEAD` (leave default merge commit and message)
** Fix various pom.xml, bump versions.,, as needed until local build work
** `git add ` changes then `git commit -m "Adapt releng for move of X, Y, Z from sourceRepo`
** Push to your fork
** Create a PR
* From the source repo
** Get back to latest master
** Remove all moved content
** Adapt pom.xml and so on until build works
** Commit
** Create PRs
* On each of both PRs, add a link to the other one, as they will need to be merged at the same time
* Once PRs are merged, trigger an I-Build and hope for a successful build in the next 40 minutes; or fix.
HTH