I am not sure how to reproduce this, or how it possibly occured, but I managed to get into a situation where git/bitbucket stored 2 branches with duplicate names.
- If i looked on bitbucket, under branches, i would see multiple branches with the same name.
- In
git branch --remote
i could only see 1 name. - If i ran
git fetch
it would always inform me of a new branch. - The 'duplicate' branches had different content, when i ran
git fetch
it would "toggle" the branches, meaning that each i ran it and did a log on the sameorigin/branch
it would show different info.
I fixed this by deleting the branch from bitbucket, leaving only one of them (the good one). I am interested in how this could possibly have happened? Is it from git, or bitbucket?