Using `git checkout -b` with and without a branch starting point
I am new to Git, I want to know the difference between two commands.
`git checkout -b <branch-name>` `git checkout -b <branch-name> origin/master`
If I execute the first command, how does Git create the branch? Will the branch be created from local master or remote master? Please help me out.
If you don't specify a starting point, the new branch is created from what you currently have checked out (the current HEAD).
git checkout -b|-B <new_branch> [<start point>]
Specifying -b causes a new branch to be created as if git-branch(1) were called and then checked out.
[...] The command’s second form creates a new branch head named <branchname> which points to the current HEAD, or <start-point> if given.