From a455417b6800a94c043a0c62a9c84038b8ea09d5 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 3 Jun 2015 21:36:46 +0300 Subject: [PATCH] Fix checkout command line More correct details about creating local branches that track remote ones. --- pep-git.txt | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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 -- 2.39.5