What I need is less than a branch, and submodule doesn't appear to be a fit.
I have a repo with three files:
- /foo.bar
- /foo1.bar
- /foo2.bar
This isn't really production code. It is demonstration code.
foo.bar is a stand alone function, and I will now build a real piece of code from it in /foo3.bar.
In a perforce context, I would branch foo.bar to foo3.bar and then start working on foo3.bar. This would give me all the history of foo.bar, and allow changes to foo.bar to be integrated into foo3.bar.
Another way to say it: I need to rename foo.bar to foo3.bar. However, live in VCS land and must always retain the full commit history. Imagine further: Over the history of foo9.bar, it has been named foo.bar, foo3.bar, and a few other names before arriving at foo9.bar. How is the full history, including all commits and all renames, done?
(And then my original scenario simply retains one of the earlier files in addition to the subsequent names. For example, foo.bar is renamed to foo3.bar, but then foo3.bar persists into the future and also becomes foo9.bar.)
How do I do this in git?