Celeb Glow
general | March 28, 2026

git branch not showing branches in terminal?

I'm using Ubuntu 16.04 and Git 2.7.4.

I just did git init and then git branch but nothing appears at all:

~/node/uui$ git init
Initialized empty Git repository in /home/alex/node/uui/.git/
~/node/uui$ git branch
~/node/uui$ 

I'm really puzzled. What could be the problem?

2 Answers

You need to make at least one commit before you can see the master branch listed by the git branch command.

3

Try this command git branch --show-current

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy