-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Research and define files migration without losing git history #5574
Comments
Update reportResearch on git native capabilities to import code with its history from another repo, it seems like the tool is capable to do so, the option Testing the solution with a dummy repository:
|
ReviewNice job @QU3B1M ! just a question: could you please check doing this with two repos? I mean, given repos A and B, create a new one C with some folders of A and some folders of B. This is just in case, because this is a more accurate scenario since we'll merge several repos into one |
On hold 🔐This issue will remain on hold until 4.9.0 release testing is complete. Issue resumed |
Update reportWorking on a more realistic solution, having some troubles when migrating with "complex" paths. WIP |
We will work with LGTM! |
Description
Currently, we are facing a migration process from different repositories to a new one, in a normal migration, all the changes history of the files are lost since they are just 'moved' from one repository to another.
This issue aims to find a way to avoid this history loss and document the process that must be followed to achieve it.
Tasks
Conclusion
After some research and testing the different solutions, I would like to highlight two different methods that we could use to accomplish the migration. None of these methods requires any plugin or installation apart from git itself:
Method 1 - Git filter-branch
Note
The CppServer team has defined a slightly different approach to this one. Link
Real life example
git clone https://github.com/wazuh/wazuh-jenkins.git cd wazuh-jenkins
git filter-branch -f --prune-empty --index-filter 'git rm --cached -r -q -- . ; git reset -q $GIT_COMMIT -- bootstrap/ new-jenkins/' -- master git gc --aggressive
Check result:
~/new_repo$ ls bootstrap new-jenkins
Pros:
Cons:
Method 2 - Git split
Real life example
git clone https://github.com/wazuh/qa-integration-framework.git cd qa-integration-framework/
cd ../new_repo git remote add integration /home/qa-integration-framework
Check results
bash ~/new_repo$ ls constants monitors
Pros:
Cons:
The text was updated successfully, but these errors were encountered: