From 946d128dd5a7d887ef4a0a3e2151349231f0fe66 Mon Sep 17 00:00:00 2001 From: Adrien Ollier Date: Wed, 16 Dec 2020 08:27:45 +0100 Subject: [PATCH] fetch original repository before use --- book/06-github/sections/2-contributing.asc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/book/06-github/sections/2-contributing.asc b/book/06-github/sections/2-contributing.asc index e7aa71e98..3f4a24cc3 100644 --- a/book/06-github/sections/2-contributing.asc +++ b/book/06-github/sections/2-contributing.asc @@ -521,14 +521,16 @@ You can automate this work with a bit of configuration: [source,console] ---- $ git remote add progit https://github.com/progit/progit2.git <1> -$ git branch --set-upstream-to=progit/master master <2> -$ git config --local remote.pushDefault origin <3> +$ git fetch progit <2> +$ git branch --set-upstream-to=progit/master master <3> +$ git config --local remote.pushDefault origin <4> ---- <1> Add the source repository and give it a name. Here, I have chosen to call it `progit`. -<2> Set your `master` branch to fetch from the `progit` remote. -<3> Define the default push repository to `origin`. +<2> Get a reference on progit's branches, in particular `master`. +<3> Set your `master` branch to fetch from the `progit` remote. +<4> Define the default push repository to `origin`. Once this is done, the workflow becomes much simpler: