From: Oleg Broytman Date: Wed, 3 Jun 2015 18:36:46 +0000 (+0300) Subject: Fix checkout command line X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=a455417b6800a94c043a0c62a9c84038b8ea09d5;p=git-wiki.git Fix checkout command line More correct details about creating local branches that track remote ones. --- diff --git a/pep-git.txt b/pep-git.txt index 118fc87..c07b68f 100644 --- a/pep-git.txt +++ b/pep-git.txt @@ -104,10 +104,22 @@ local repo has two branches ``v1`` and ``v2``. For most examples the currently checked out branch is ``v2``. That is, it's assumed you have done something like that:: + $ git clone -b v2 http://git.python.org/python.git + $ cd python + $ git branch v1 origin/v1 + +The last command creates a new local branch v1 and sets +remotes/origin/v1 as its upstream remote branch. + +The same result can achieved with commands:: + $ git clone -b v1 http://git.python.org/python.git $ cd python - $ git fetch origin v2:v2 - $ git checkout -b v2 + $ git checkout --track origin/v2 + +The last command creates a new local branch v2, sets +remotes/origin/v2 as its upstream remote branch and checks it out into +the working directory. Branches and branches