HelloWorld
HelloWorld

Reputation: 97

Basic questions about git checkout -b

I'm new to git and github and have this scenario:

  1. I have a repo in github
  2. I've cloned locally
  3. I've created a new branch from my CLI by doing:

git checkout -b new_branch

Upvotes: 0

Views: 51

Answers (1)

Romain Valeri
Romain Valeri

Reputation: 21938

A) Yes, with the push command.

B) Yes, it means that this commit is where the branch new_branch is pointing at, which is also the case for master since you didn't already commit on this branch, it's expected that they're "at the same point" for now.

It also means that new_branch is checked out since HEAD points to it.

C) It's not because the branch doesn't exist on remote, it's because your local branch doesn't have yet somewhere to send it (what's called an upstream branch). You could set it with the -u flag of the push command.

Upvotes: 1

Related Questions