right now i have several projects tracked with git. Now, i want to make one big project, with several subfolders for each of the previous projects and preserve their history along with the history of the big project.
So basically what i have now is
projecta/
projectb/
projectc/
bigproject/
And what i want is
bigproject/
projecta/
projectb/
projectc/
Is that even possible without losing history?
Cheers
You could try:
#Preparing the repos: moving files in subdirectories
cd projecta
mkdir projecta
git mv file1 file2 dir1 dir2 projecta
git commit -am "Moved file"
#Do it for each other repos
#Actually merging
git clone url_to_projecta bigproject
cd bigproject
git remote add b url_to_projectb
git remote add c url_to_projectc
git fetch --all
git merge b/master
git merge c/master
In plain English: You can merge Git trees even if they have nothing in common, so you just have to:
That's it.
And if you want to have a filesystem which looks like:
bigproject/
projecta/
projectb/
projectc/
the easiest is to deal with it first
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With