I apologize if this is trivial but I've spent the better part of the night searching for a solution and I'm a bit stuck. I've been using Git for version control of a project for which I'm currently the only developer, and after spending a bunch of time working with a given bunch of code, I'd like to start from scratch in my master branch but "archive" all of my previous work in the current master branch and others within my existing repository. I currently have a bunch of commits in the master branch followed by a second series of commits in branch A; it looks something like this:
A: C4-C5-C6
/
master: C0-C1-C2-C3
I'd like to prepend an empty commit to the project (my current initial commit is not empty), store my current history in a set of branches preserving the hierarchy, and then start working off of that empty commit with new code. That would look something like this:
A: C4-C5-C6
/
oldcode: C0-C1-C2-C3
/
master: C0' (empty)-C7...
I hope that that makes sense, I get the sense that I'd need to some rebasing but I'm not exactly sure how that would work and I don't want to lose what I already have by accident. Any help would be greatly appreciated, thanks!
EDIT: It just occurred to me that I could potentially just clone copy the current master branch to a new branch to an old branch, commit, and then wipe my working directory in the master branch and commit again. This preserves the actual time-line and my old code, and is probably more "proper". Does that make sense? It would look something like:
A: C4-C5-C6
/
master: C0-C1-C2-C3-C8(empty)-C9...
\
oldcode: C7
Thanks!