Need some help with svn to git/ git to git migration with history.
The old svn repo was migrated to git (with history). This git repo, now old, was then copied to a newer git repo location, but unfortunately without preserving any history from the inital svn to git migration).
Since then, there have been changes to the svn repo as well as the old git repo. The master branch of the new git repo is protected
I would like to do either of the following, which ever is easier:
- Migrate all the new changes from the old git repo to the new git repo with ALL the history (including the history from the initial svn to git migration.) OR
- Migrate the new svn changes to the new git repo, WITH all the svn history. I can then copy over or manually add the new old git repo changes to the new git repo.
Thanks!
EDIT: Adding more clarification or details:
- The old_git_repo was copied over to a new_git_repo but without preserving its history.
- Additionally, there were changes made to the old_git_repo which now need to migrated over to the new_git_repo as well.
- The migration should include all the history of the old_git_repo, that was missed with the initial migration to new_git_repo, and also the new changes made in the old_git_repo
Will the below work?
- In my new_git_repo, I will create a new branch migrate_old_git_to_new_git
- Run git clone --mirror git_repo_dir (will this work?)
Will step#2 get all the current changes to the old_git_repo including the history? If yes, then I should be able to create the MR and merge/ overwrite with history and new changes? Thanks!
Do I need to create a new branch like in step 1 or can I do the clone --mirror on master?