mttp
mttp

Reputation: 13

When I type 'git branch' nothing happens

So far, I have cloned an empty git repo, and created a new branch with 'git checkout -b branchname'. My understanding is that typing 'git branch' should now give me some output like

* mybranch
  master

Instead, I get no output at all. However, entering 'git status' still tells me

# On branch branchname
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)

So why don't I get any output from 'git branch'?

Upvotes: 1

Views: 1907

Answers (1)

André Puel
André Puel

Reputation: 9219

I am not aware of any git -b command. Did you mean git checkout -b branchname (which creates the branch and switches to it)?

You can create a branch doing git branch branchname.

Also, you can use git branch -a which list the remote branches also.

EDIT: By the way. If you have no commit (Just saw your "#Initial commit"), you do not have any branch (not even master). You must make your first commit first.

Upvotes: 2

Related Questions