I simply cloned a repo, then performed git fetch. I haven't created any branches, nothing is tracked. When I type "git branch" it shows (besides "master") a hundreds of remote branches in the form: /Dev/Project/<sth>. The heads subdirectory is empty. I always thought that git branch shows only local branches by default and always. And this is true for other, similar projects. from the same server. So why I see them all in this particular case? And how to get rid of all of them?
update: These unwanted branches appear in .git/refs/remotes/<remotename>. But the funny thing is that I see more branches in this location. Some of them don't appear in git branch output (expected), only ones that start with /Dev or /Feature pollute the console. I cannot recognize any rule for it.
update: Now i see that git fetch creates these unwanted branches locally:
* [new branch] Dev/... -> remotename/Dev/...
Why? I don't see any option to prevent git fetch from doing it.
update: Config for remote that pollutes is as follows (I think it is correct):
[remote "BB"]
url = ssh://.....
fetch = +refs/heads/*:refs/remotes/BB/*
update: My global git configuration:
push.default=upstream
push.followtags=true
user.name=me
user.email=me@mycompany.com
merge.ff=false
core.filemode=false
core.autocrlf=input
core.trustctime=false
pull.rebase=true
pull.ff=true
diff.tool=meld