Reputation: 97
I'm new to git and github and have this scenario:
git checkout -b new_branch
Question A: I've found out that this new_branch branch hasn't been created on my github project. Is this because I'm supposed to upload it?
Question B when a do a git log I get: commit 9a0b7a..truncated (HEAD -> new_branch, master). Am I on new_branch, right? if so, why it says master as well?
Question C: I tried doing git merge so that my local changes are being pushed but got this: fatal: No remote for the current branch. So, this is because my new_branch still doesn't exist on github. What should I do to make it appear on github now?
Upvotes: 0
Views: 51
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