3 Clarify answer and quote documentation.
source | link

You can easily switch to a branch without using the fancy "git checkout -b somebranch origin/somebranch" syntax. You can just do:

git checkout somebranch

Git will automatically do the right thing:

$ git checkout somebranch
Branch somebranch set up to track remote branch somebranch from origin.
Switched to a new branch 'somebranch'

Git will check whether a branch with the same name exists in aexactly one remote, and if it does, it tracks it the same way as if you had explicitly specified that it's a remote branch. From the git-checkout man page of Git 1.8.2.1:

If <branch> is not found but there does exist a tracking branch in exactly one remote (call it <remote>) with a matching name, treat as equivalent to

$ git checkout -b <branch> --track <remote>/<branch>

You can easily switch to a branch without using the fancy "git checkout -b somebranch origin/somebranch" syntax. You can just do:

git checkout somebranch

Git will automatically do the right thing:

$ git checkout somebranch
Branch somebranch set up to track remote branch somebranch from origin.
Switched to a new branch 'somebranch'

Git will check whether a branch with the same name exists in a remote, and if it does, it tracks it the same way as if you had explicitly specified that it's a remote branch.

You can easily switch to a branch without using the fancy "git checkout -b somebranch origin/somebranch" syntax. You can just do:

git checkout somebranch

Git will automatically do the right thing:

$ git checkout somebranch
Branch somebranch set up to track remote branch somebranch from origin.
Switched to a new branch 'somebranch'

Git will check whether a branch with the same name exists in exactly one remote, and if it does, it tracks it the same way as if you had explicitly specified that it's a remote branch. From the git-checkout man page of Git 1.8.2.1:

If <branch> is not found but there does exist a tracking branch in exactly one remote (call it <remote>) with a matching name, treat as equivalent to

$ git checkout -b <branch> --track <remote>/<branch>
2 added 168 characters in body
source | link

You can easily switch to a branch without using the fancy "git checkout -b somebranch origin/somebranch" syntax. You can just do:

git checkout somebranchgit checkout somebranch

Git will automatically do the right thing:


$ git checkout somebranch
Branch somebranch set up to track remote branch somebranch from origin.
Switched to a new branch 'somebranch'
$ git checkout somebranch
Branch somebranch set up to track remote branch somebranch from origin.
Switched to a new branch 'somebranch'

Git will check whether a branch with the same name exists in a remote, and if it does, it tracks it the same way as if you had explicitly specified that it's a remote branch.

You can easily switch to a branch without using the fancy "git checkout -b somebranch origin/somebranch" syntax. You can just do:

git checkout somebranch

Git will automatically do the right thing:


$ git checkout somebranch
Branch somebranch set up to track remote branch somebranch from origin.
Switched to a new branch 'somebranch'

You can easily switch to a branch without using the fancy "git checkout -b somebranch origin/somebranch" syntax. You can just do:

git checkout somebranch

Git will automatically do the right thing:

$ git checkout somebranch
Branch somebranch set up to track remote branch somebranch from origin.
Switched to a new branch 'somebranch'

Git will check whether a branch with the same name exists in a remote, and if it does, it tracks it the same way as if you had explicitly specified that it's a remote branch.

1
source | link

You can easily switch to a branch without using the fancy "git checkout -b somebranch origin/somebranch" syntax. You can just do:

git checkout somebranch

Git will automatically do the right thing:

$ git checkout somebranch
Branch somebranch set up to track remote branch somebranch from origin.
Switched to a new branch 'somebranch'