6

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?

8

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

  • 2
    Who would have guessed? – alex Mar 17 '17 at 14:18
  • 2
    My guess is that HEAD needs to point to a commit, so if there are no commits, there is nothing HEAD can point to, therefore there are no branch names. – edwinksl Mar 17 '17 at 14:20

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.