I have a git branch "hotfix/foo" that exists on the remote repository. Now I have created a local one with the name "hotfix/foo/bar". It will be created locally without problems. I have only the remote ref of the first branch (not pulled the "hotfix/foo" branch) on my local machine.
I cannot push the new branch "hotfix/foo/bar" to remote. Only when I delete the "hotfix/foo" on the remote, I can now push.
I am using Git for Windows, version 2.51.2.windows.1. I tried both, running it via the CMD and from VisualStudio 2026. The remote repository is stored on Azure DevOps.
Is that normal behaviour? Are there any docs pointing to this naming restriction? It happened to me twice with different synonyms for foo and bar.
This question has the same answer as this question, because the fundamentals of git cause the issues. The only difference is, that my symptoms were different.
.gitdirectory) - you can't have a directory with the same name as a (leaf) file.