The TL;DR of all of this is that you've set out conflicting requirements. You cannot have what you've asked for.
History, in any Git repository, is simply the set of commits in the repository, with their embedded relationships.
Branch names, in any Git repository, are names for the last commits in long chains of commits. That's all they are. They do not really exist on their own: they depend on the commits. They need commits just to exist. You cannot have a branch name without a commit.
Commits should in general relate to each other. If you wish to have three different branch names pointing to three different commits, these three commits should relate somehow. For them to relate, you must have one of one or more of these properties:
- the commits are direct parent/child of each other, so that this is their history; or
- the commits have common ancestors, i.e., history.
Mickael B.'s answer shows you how to take any one existing commit and make a new commit from it, with the new commit having no parent at all. That is, the new commit is a root commit. You could do this for each of your three branch names, but the result will be three unrelated commits. This means you will not be able to merge work done on any of these three branches with work done on any of the other branches. Each branch has a history: it's just that its history consist of a single commit (i.e., that's how long the "long chain" is).
If that's OK, just repeat his answer three times (three git checkout --orphan
operations). If not, find some suitable ancestor commit and make that first, as your new --orphan
branch, then add your three other commits atop this, perhaps like this:
o--o <-- original-branch2
/
...--o--...--o--o <-- original-master
\
o--...--o <-- original-branch1
o <-- new-orphan
\
o <-- new-branch1
\
o <-- new-branch2
\
o <-- new-master
or like this:
o <-- new-branch1
/
o <-- new-orphan
\___
\ `o <-- new-master
\
o <-- new-branch2
for instance.