Hombrew creates a 'stable' branch out of nowhere (?)

Good day guys, I’m facing this kind of problem:

every time I do ‘brew update’ or ‘brew upgrade’ or ‘brew cask upgrade’ I face this message:

then I realized that I have 2 branches (‘git branch -a’) in Homebrew local repository (’/usr/local/Homebrew’), ‘master’ and ‘stable’ and it is pointing to ‘stable’ branch by default. As far as I know there is no stable branch in Hombrew GitHub repository.

The thing is that when I checkout to ‘master’ branch and then delete the ‘stable’ branch the error message in the first image disappears but then eventually it creates the ‘stable’ branch again, I’ve try it many times deleting this branch and it keeps creating it again…

I’ve search this for quite a while but haven’t found anything about it. I might be misunderstanding something.

is ‘stable’ branch created by Homebrew by default? Is it safe and normal? Does Homebrew have to point to ‘master’ branch always?

Appreciate your help! Thanks.

What does brew doctor say?

It says:

but I have this same message since I installed Homebrew on my laptop though

See if there’s a .lock file in Homebrew’s git repository cd $(brew --repo)/.git. You should delete it if it’s there.

Homebrew normally creates a stable branch that points to the latest tagged version. This is expected behavior.

1 Like

There is a file called ‘config.lock’ in my Hombrew local repository and it has nothing in it:

It seems that the ‘problem’ was solved. I deleted the ‘config.lock’ file, as you said, which I think was preventing from writing into ‘config’ file after calling ‘brew update/upgrade/cask upgrade’ function.

Thanks @jonchang!