Git orphan branch still shows history

My understanding of

git checkout --orphan <name>

is that:

Create a new orphan branch, named <new_branch>, started from <start_point> and switch to it. The first commit made on this new branch will have no parents and it will be the root of a new history totally disconnected from all the other branches and commits.

So I want to use this approach to track dotfiles from different machines in the same repo, just under independent branches.

I created “dotfiles” repo on GitHub and ran the following on my Mac:

mkdir dotfiles
cd dotfiles
git init
git checkout --orphan mac
git add .zshrc
git commit -m "Added zshrc"
git remote add origin https://github.com/<my_name>/dotfiles.git
git push --set-upstream origin mac

Then basically did the same on my raspberry pie

mkdir dotfiles
cd dotfilest
git init
checkout --orphan rpi
git add .zshrc
git commit -m "Added zshrc"
git add .emacs
git commit -m "Added emacs"
git remote add origin https://github.com/<my_name>/dotfiles.git
git push --set-upstream origin rpi

Everything worked fine and I have 2 branches, except on GitHub the rpi branch shows that

This branch is 2 commits ahead, 1 commit behind mac.

How is this possible? If:

have no parents and totally disconnected from all the other branches and commits

Or is my understanding of --orphan option incorrect?

1 Like

That is weird. You sure it’s the orphan branch?