I had a project that I can’t fill normally on gitlab and this time everything seemed to work fine, but when I write in the terminal

git branch 

it shows me all the available branches (in my case, it is one)

 aleksey@aleksey:~/Downloads/NTZ/FittingRoom$ git branch * new 

And for some reason it is called my new ...

Although this is when I had a project on the last repository I tried to create branches there and there was such a new , but then I deleted everything like ...

So now I have the main branch called new ...

How to fix it?

EDIT

 aleksey@aleksey:~/Downloads/NTZ/FittingRoom$ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/master 

    1 answer 1

    You can rename a local branch with the same branch command:

     $ git branch -m старое-имя новое-имя 
    • So I understand that the git branch command shows me all the branches and those that are on the server too ... I understand that this is not a local new branch but the one on the server ... Or not? - Aleksey Timoshchenko
    • without options / parameters, the branch command displays only local branches. with the -r option — only remote, with the -a option — both. - aleksandr barakin
    • And you can still tell, so I added to the question that the git branch -a command shows me and there are 3 branches ... one local master and the other two that are deleted ... But why two? and how to understand this remotes/origin/HEAD -> origin/master - Aleksey Timoshchenko
    • The HEAD file contains a link either to a branch (as in your case) or to a commit (so-called detached head ). if you are given an exhaustive answer, please mark it as accepted. - aleksandr barakin 5:28 pm