Using `git checkout -b` with and without a branch starting point -


i new git, want know difference between 2 commands.

`git checkout -b <branch-name>` `git checkout -b <branch-name> origin/master` 

if execute first command, how git create branch? branch created local master or remote master? please me out.

if don't specify starting point, new branch created have checked out (the current head).

git-checkout:

git checkout -b|-b <new_branch> [<start point>]

specifying -b causes new branch created as if git-branch(1) called , checked out.

and git-branch:

[...] command’s second form creates new branch head named <branchname> points current head, or <start-point> if given.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -