1

When I started with my simple project I didn't use any repository to store changes. I just created a backups with simple ZIP files. I have many of them like this:

  • backup_1_added_feature_a.zip
  • backup_2_added_feature_b.zip
  • ...
  • backup_N_added_feature_z.zip

At some point I switched to GIT. The first commit I made from my last ZIP sources, and I have already some new commits done:

origin/master: (C1)<-(C2)<-(C3) ...

( C1 == backup_N_added_feature_z.zip )

Now I would like to add my backup zip's in to the main trunk like this:

origin/master: (zip1)<-(zip2)<-(zip3) ... (zipN)<-(C1)<-(C2)<-(C3) ...

Is it possible in GIT?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Knight of Ni
  • 1,780
  • 3
  • 20
  • 47

1 Answers1

1

There's a manual way to do it.

git checkout --orphan newroot
git rm -rf .
# unzip zip1 to project directory
git add .
git commit  -m 'zip1'
# unzip zip2 to project directory
git add .
git commit  -m 'zip2'
...
git rebase --onto newroot --root master
git branch -d newroot

You can replace manual unpacking/adding/commiting of zip folder with a bash for loop, obviously.

See https://stackoverflow.com/a/647451/2578489 for explanation.

Community
  • 1
  • 1
Ruslan Osipov
  • 5,655
  • 4
  • 29
  • 44