I used to work on a project with my team and we used svn for version control before we moved to git and now the svn history is long gone. I have the original sources we started working with and I want it to show up in git history so I can see the changes we made from git or the IDE.
To be able to do this I have to be able to put the original sources below the existing commits without keeping anything of it.
How the history looks like now:
How I want it to look like:
We also removed or renamed many files and I don't want them to belong to the current state of the repository. The best I could do is checking out the readme commit on a new branch, placing the old sources on top of it, and then merging the master into the branch using the theirs strategy to overwrite the files. I could see the old sources as the second commit and then a merge commit on top of the last change. It kept the removed or renamed files and didn't show history for the existing ones.
Is this even possible to do without having to rebuild the entire repo?
I'm not quite getting what you want.... but if I understand correctly, you want to add the old sources before the new sources... and you moved a lot of files between old sources and new sources, right?
Ok.... do this:
git checkout -b temp revision1
// put the _old_ sources here
git add .
git commit -m "Old sources"
git checkout revision2 # where you have the new sources
git reset --soft temp # set the branch pointer in "old sources keep all files the way they are, everything that changed will be in index... even moved files
git commit -m "new sources¨
# let's move temp branch's pointer
git branch -f temp
git checkout temp
# now we replicate the other changes from master (master, right?)
git cherry-pick revision2..master
# if you like the result
git branch -f master # set master over here
git checkout master
git branch -d temp
And you are done