PROBLEM:
I used these commands to create a two new branches. New branch GTEC-426-eth was supposed to originate from feature/eth_testing while new branch GTEC-426-ksz was supposed to originate from the feature/KSZ8851SNL_testing.
git worktree add -b GTEC-426-eth ../worktrees/GTEC-426-eth feature/eth_testing
git worktree add -b GTEC-426-ksz ../worktrees/GTEC-426-ksz feature/KSZ8851SNL_testing
After changes were done on these new branches, they were pushed to the origin.
git push --set-upstream origin GTEC-426-eth
git push --set-upstream origin GTEC-426-ksz
Now I am checking the Gitlab graph and it seems that this did not add new branches but renamed the existing ones...
This is the graph from tig GIT client if I run it from the GTEC-426-ksz branch:
This is a graph of GTEC-426-ksz branch on Gitlab:
What did I do wrong?
POSSIBLE REASONS:
I read in the man git worktree about -b:
-b <new-branch>, -B <new-branch>
With add, create a new branch named <new-branch> starting at <commit-ish>, and check out <new-branch> into the new working tree. If <commit-ish> is omitted, it defaults to HEAD. By default, -b refuses to create a new
branch if it already exists. -B overrides this safeguard, resetting <new-branch> to <commit-ish>.
I am working on Windows/WSL and I suspect that because Windows has problems with normal/capital letters it might interpreted -b as -B... I have no other idea why this could otherwise happen...


I understand now. All the git graphs use horizontal space saving if possible.
Let us take a look at the Graph from GitLab from earlier:
Here, it really looks like branch
feature/eth_testingwas renamed toGTEC-426-ethbut this is not the case. Branchesfeature/eth_testingandGTEC-426-ethreally are two different branches! So a normal person like me would expect this part of graph to look like this:This looks nicer, but look how much horizontal space it takes! This is why, to save horizontal space, git draws a graph in a single line and marks the end of each branch like shown in the first image. It will continue to do this until it can - until there is another commit on branch
feature/eth_testing. When this happens, it will be forced to moveGTEC-426-ethbranch out of the way and draw a graph like this:I tested this by creating additional commit on
feature/eth_testingand graph really behaved like just described:NOTE: I also had to use
tig --allinstead of simplytigto see all the branches.