From patchwork Tue Apr 21 13:12:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shourya Shukla X-Patchwork-Id: 11501291 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 424EC913 for ; Tue, 21 Apr 2020 13:12:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A7DA20775 for ; Tue, 21 Apr 2020 13:12:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FB6ahO7W" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728676AbgDUNMg (ORCPT ); Tue, 21 Apr 2020 09:12:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726018AbgDUNMf (ORCPT ); Tue, 21 Apr 2020 09:12:35 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DE6AC061A10 for ; Tue, 21 Apr 2020 06:12:35 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id r14so6584399pfg.2 for ; Tue, 21 Apr 2020 06:12:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YpbTyU3zepC+cB3HS5q+NtuYKOns6RRNNtTfLVybn3k=; b=FB6ahO7WEY0OLMj89EoowuoGm8r8GueiP+3FKyl2IcOD+x4nPXmUf34BVF3SlSpMV/ HDmZCuoAhqL7Y8eyt3ZVcJonPFoyHPC28ZTenXGBTX0EecPp3/WA9kidAz5dQ3B7rHnt LcKfMrHaY7lKxh8wUbfKRU+MahWmHwhQXqT00DRaAaisU1F9sazU3UZeN2S6bBtCHiPs kIrKlGwC0eLI3DHJ/nGMnj7Azt1vO5kYq4mRZ8czDGdTPvOnBrTdlRuA7n2dDSX4Swp7 /arpwIWisVmh9/Kc6N4keRMv6PIKwh8oS2fxIXJnFJTiDOj2IywWOe1+x4mnVUQyRyQA NoKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YpbTyU3zepC+cB3HS5q+NtuYKOns6RRNNtTfLVybn3k=; b=QCp0r5Fb5LNDIRXiAsGE0CW6irE6o71f4FdIsV8AM2XQL5cxWankSKbqsD+7dGn4Kr qup0Q1m1FVsSpOPPeIqKgqUhbpItHC5y9ZrvZuD6LNwfZ8wQdyhdIy5zmXN8ng+lIwsA o1IvuW+TjW5DRHeqmkMiu3i4GLbp4T3nRf8NFMdlLwPxMar/dzD+Zbi7XojM39086oXG FUg7jPldooK5GO0/qxa/dZJ86UZ9EH/8o9DF9IT6PkGRqLuG6qiHv1IEJ1jRnWYIta13 oIKu0x1mQzgr8rkscnw+wHYRNuY2xQZ/fojxAmaLBA4x2I8VSnoz5rXe4WsBz484jE30 V5sA== X-Gm-Message-State: AGi0PuY8vfHNwwU77X1L37py70vlvhlBc4VRfRbvXa4CyOi5WHpgmwmO 2fP8hNyTzEnCStMYfngY9m120uGWrI4= X-Google-Smtp-Source: APiQypJUz4bvyDd1oqK+EM7B7xSWf/UWXYS3F2DV8iqdStGq79Ug6r7Aq1M587HBwtgc/Z76tcl80g== X-Received: by 2002:a63:7c1:: with SMTP id 184mr20688903pgh.77.1587474754645; Tue, 21 Apr 2020 06:12:34 -0700 (PDT) Received: from konoha.iitr.ac.in ([103.37.201.175]) by smtp.gmail.com with ESMTPSA id g2sm2451492pjd.9.2020.04.21.06.12.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 06:12:33 -0700 (PDT) From: Shourya Shukla To: git@vger.kernel.org Cc: gitster@pobox.com, sandals@crustytoothpaste.net, Shourya Shukla Subject: [PATCH v3 1/4] gitfaq: files in .gitignore are tracked Date: Tue, 21 Apr 2020 18:42:20 +0530 Message-Id: <20200421131223.29337-2-shouryashukla.oo@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200421131223.29337-1-shouryashukla.oo@gmail.com> References: <20200421131223.29337-1-shouryashukla.oo@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Add issue in 'Common Issues' section which addresses the problem of Git tracking files/paths mentioned in '.gitignore'. Signed-off-by: Shourya Shukla --- Documentation/gitfaq.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt index 1cf83df118..96767e7c75 100644 --- a/Documentation/gitfaq.txt +++ b/Documentation/gitfaq.txt @@ -223,6 +223,27 @@ a file checked into the repository which is a template or set of defaults which can then be copied alongside and modified as appropriate. This second, modified file is usually ignored to prevent accidentally committing it. +[[files-in-.gitignore-are-tracked]] +I asked Git to ignore various files, yet they are still tracked:: + Git ignores files matching the patterns stated in the '.gitignore'. + Consequently, `git add` does not add the files/paths matching the + pattern in `.gitignore`, meaning they remain untracked; `git status` + does not list the aforementioned files/paths as untracked. + + One thing to note is that the `.gitignore` mechanism applies only + to the files that are not already tracked. A file/path that is + already tracked will stay to be tracked even if you add a pattern + that happens to match it to `.gitignore` file. + + This is probably the reason why Git shows some files/paths in the + staging area. These entities were being tracked before and later + were added in the `.gitignore`, due to which they show up in the + staging area. + + To completely ignore and untrack files/paths falling in the above + category, it is advised to use `git rm --cached ` as well as + add these files/paths in the `.gitignore`. + Hooks ----- From patchwork Tue Apr 21 13:12:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shourya Shukla X-Patchwork-Id: 11501293 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9D55913 for ; Tue, 21 Apr 2020 13:12:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B24B020775 for ; Tue, 21 Apr 2020 13:12:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RfuM18KK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728739AbgDUNMi (ORCPT ); Tue, 21 Apr 2020 09:12:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726018AbgDUNMi (ORCPT ); Tue, 21 Apr 2020 09:12:38 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D756C061A10 for ; Tue, 21 Apr 2020 06:12:38 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id r4so6741252pgg.4 for ; Tue, 21 Apr 2020 06:12:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nPGXNRz08nd5NAQZZyjrUa9x/USDr2TA+UONIpWHaEw=; b=RfuM18KK4xRM3pf00VuPw6RBgp5FDTZR/ON/QiNVGsq5yLbvLa6qrkD78f5dEnjf8S 6mbHMUiXcZnvKHyTgTaH0xgGXiwitNb+y5tzbV4m4k8V8x2apmLgw4YQG1h25SevWBWr ztx8fFMfFXpxwxTJiNps7FyVk0kO0P7BcDR4g8c9uIapkMnKQ/Nd7ptU/kh+kCQsui7h Op3cb44YXo2KlDMUZ+gVpShTBfqkhTee+2BUoAUwQ1Uc+CZQkm1BwXQgy4haC2mfV2Xv vBJb/DQZdmJ/p49F4erZRFsqcXgBczzsmH9hlS0enz62Bafx9OQovGYzLba35IszcXbw 78mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nPGXNRz08nd5NAQZZyjrUa9x/USDr2TA+UONIpWHaEw=; b=Urq5f9Au5sgUqI6ZyDsUuL76x97DoiVkbfY89CMgQgRzV6wm5SK+lHSN8oaqn/nUev iqeyt4F/pr0ZQXJNiLyY24O8Iau6UxHUrklketdyjeLb9w4tXDJtIUHzSBkTWiE6cYff mYfGzTv8FImL8raGGSiQCnYuSao011SifzdnIR4X2d92tuPRas0nrGF95u5zIBTzjUxa 2A5H4gjK1Upuan00DjprZHeD4zNzYyCHJaZCbAlVKVo3Daz08uXGTWHn/XZ1obtX8Jdg xpPdjw5rH7PByTLlxrHn1HfqUSaabiUpBBEowea+HMzext38WsC/B7NUk5UeEpRT+qTL IRzA== X-Gm-Message-State: AGi0PuYKlDAX9ljBbB/5yu1fO8AmfSRXh978LNHv8EV71STvoWB4U0ZK tqniJSgEILXtswr9sf75jSCyTiPaMTw= X-Google-Smtp-Source: APiQypLprAY4mwOwJCM37SycuY/dcE76YOkRZCQVihuK+ale8l7O2VKBnDYzjXmuAZ+rGojbhxY+3A== X-Received: by 2002:a63:4665:: with SMTP id v37mr20184694pgk.297.1587474757428; Tue, 21 Apr 2020 06:12:37 -0700 (PDT) Received: from konoha.iitr.ac.in ([103.37.201.175]) by smtp.gmail.com with ESMTPSA id g2sm2451492pjd.9.2020.04.21.06.12.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 06:12:36 -0700 (PDT) From: Shourya Shukla To: git@vger.kernel.org Cc: gitster@pobox.com, sandals@crustytoothpaste.net, Shourya Shukla Subject: [PATCH v3 2/4] gitfaq: changing the remote of a repository Date: Tue, 21 Apr 2020 18:42:21 +0530 Message-Id: <20200421131223.29337-3-shouryashukla.oo@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200421131223.29337-1-shouryashukla.oo@gmail.com> References: <20200421131223.29337-1-shouryashukla.oo@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Add issue in 'Common Issues' section which addresses the problem of changing the remote of a repository, covering various cases in which one might want to change the remote and the ways to do the same. Signed-off-by: Shourya Shukla --- Documentation/gitfaq.txt | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt index 96767e7c75..13d37f96af 100644 --- a/Documentation/gitfaq.txt +++ b/Documentation/gitfaq.txt @@ -244,6 +244,37 @@ I asked Git to ignore various files, yet they are still tracked:: category, it is advised to use `git rm --cached ` as well as add these files/paths in the `.gitignore`. +[[changing-remote-of-the-repository]] +I want to change the remote of my repository. How do I do that?:: + A remote is an identifier for a location to which Git pushes your + changes as well as fetches any new changes from (if any). There + might be different circumstances in which one might need to change + the remote: + + 1. One might want to update the URL of their remote; in that + case, the command to use is, `git remote set-url `. + + 2. One might want to have two different remotes for fetching + and pushing; this generally happens in case of triangular + workflows: one fetches from one repository and pushes to + another. In this case, it is advisable to have separate + remotes for fetching and pushing. But, another way can be + to change the push URL using the `--push` option in the + `git set-url` command. + + 3. One might want to push changes to a network protocol + different from the one they fetch from. For instance, + one may be using an unauthenticated http:// URL for + fetching from a repository and use an ssh:// URL when + you push via the same remote. In such a case, one can + change the 'push' URL of the same remote using the `--push` + option in `git remote set-url`. Now, the same remote will + have two different kinds of URLs (http and ssh) for fetching + and pulling. ++ +One can list the remotes of a repository using `git remote -v` command. +The default name of a remote is 'origin'. + Hooks ----- From patchwork Tue Apr 21 13:12:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shourya Shukla X-Patchwork-Id: 11501295 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 22C686CA for ; Tue, 21 Apr 2020 13:12:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08C8D20781 for ; Tue, 21 Apr 2020 13:12:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Duhe1ssf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728807AbgDUNMl (ORCPT ); Tue, 21 Apr 2020 09:12:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726018AbgDUNMl (ORCPT ); Tue, 21 Apr 2020 09:12:41 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DE73C061A10 for ; Tue, 21 Apr 2020 06:12:41 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id y22so5233304pll.4 for ; Tue, 21 Apr 2020 06:12:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tbjunoraeX9VfPfmZqdgd15dB7xxu3AeaqbkoRLnoH4=; b=Duhe1ssfYAhzag/DCcedPP4A6ae8dLNb66Yb7thIFlFvf0ZOy7jdkaNL/0Q3GSmmBu F/YU4BASoh5+VelkpN/tTn5r2sC8hsqyzpzZbTRixNGYOfLrQUJ8cwvBJB9eLjiPGV1Q 4v+TFvAIqFNlV5lIlplEsXoSb+ssP5EFMjYDDS7LFMNOdjhENsa57OL+CghB5aVXkHNu wS3/rldk8IuYAPge1ZT07IwVmFIC3Iv/5BHoRy5TxJr1AgqqmXzQCryXpgmUFrqk9ghp T237rjS6qeVMTvvt/CEWi5dx1LiL9eCNGoaIfr+JCbCU09lQT0K0RrWdhK16RL3a+v4Y P7mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tbjunoraeX9VfPfmZqdgd15dB7xxu3AeaqbkoRLnoH4=; b=RiqtqNLm3uh9x/n5MJ+r7thX3JmBp6YqYgSPdT74detssvyKwpleyj1jxDX6YgNA/c 4kBZph6xaWYjKvSfzfKl810EIvY/oEaHpcMPDpgeCf0qn08zNaxnFSg4JGi6oUeHTsNq AQPxV/f2s87diU3vcD2kmDpqXw7xMQ3ndVERnacP0qXogDWpIZLJXKqp0Gp7YuolVQ5p 3x/pQroak64D87PQjF8QE1eneimQa95UrtRvRpTgrlHPDnnDe0ki0f2Lb9u/Xrh6WQA+ CySyGQ8l9+YC0IbR5YmJzknlScX6X+cqpBG6ON7gOP8q8dPQusMBLMZGEjho6rQ3SAgH idyA== X-Gm-Message-State: AGi0PuYNQKKya0KinznvjgjFkTw720SBpbzZ773G7EoLgc9YHkRpn6oj vkBYLPPtM1y3LNWQSvCAg2lc4GrjdAU= X-Google-Smtp-Source: APiQypK1QNb7GxpufV0K2F8XdlsVNM/3kzECPtk3T+Ba6mWL0ASGzhvUiYsiGPGfFxoyIKVM8mNEXQ== X-Received: by 2002:a17:90b:1b05:: with SMTP id nu5mr5523310pjb.110.1587474760187; Tue, 21 Apr 2020 06:12:40 -0700 (PDT) Received: from konoha.iitr.ac.in ([103.37.201.175]) by smtp.gmail.com with ESMTPSA id g2sm2451492pjd.9.2020.04.21.06.12.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 06:12:39 -0700 (PDT) From: Shourya Shukla To: git@vger.kernel.org Cc: gitster@pobox.com, sandals@crustytoothpaste.net, Shourya Shukla Subject: [PATCH v3 3/4] gitfaq: shallow cloning a repository Date: Tue, 21 Apr 2020 18:42:22 +0530 Message-Id: <20200421131223.29337-4-shouryashukla.oo@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200421131223.29337-1-shouryashukla.oo@gmail.com> References: <20200421131223.29337-1-shouryashukla.oo@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Add issue in 'Common issue' section which covers issues with cloning large repositories. Use shallow cloning to clone the repository in a smaller size. Signed-off-by: Shourya Shukla --- Documentation/gitfaq.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt index 13d37f96af..cea293cf07 100644 --- a/Documentation/gitfaq.txt +++ b/Documentation/gitfaq.txt @@ -275,6 +275,20 @@ I want to change the remote of my repository. How do I do that?:: One can list the remotes of a repository using `git remote -v` command. The default name of a remote is 'origin'. +[[shallow-cloning]] +The repository I am trying to clone is too big. Is there an alternative +way of cloning it in lesser space?:: + One can clone a repository having a truncated history, meaning the + history will span upto a specified number of commits instead of + the whole history of the repository. This is called 'Shallow Cloning'. + This helps to decrease the space taken up by the repository. + Shallow cloning can be done by using the `--depth` option + while cloning. Therefore, the command would look like: + `git clone --depth `. + Here, 'n' is the depth of the clone. For e.g., a depth of 1 + would mean fetching only the top level commits of the repository + See linkgit:git-clone[1]. + Hooks ----- From patchwork Tue Apr 21 13:12:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shourya Shukla X-Patchwork-Id: 11501297 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B898F6CA for ; Tue, 21 Apr 2020 13:12:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 964DA2076A for ; Tue, 21 Apr 2020 13:12:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nBZQcVxO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728900AbgDUNMr (ORCPT ); Tue, 21 Apr 2020 09:12:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728866AbgDUNMo (ORCPT ); Tue, 21 Apr 2020 09:12:44 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF0ABC061A10 for ; Tue, 21 Apr 2020 06:12:43 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id n24so5212299plp.13 for ; Tue, 21 Apr 2020 06:12:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rzJ9J1wtHzrN/KosoPr/+d14bcRLxzvn6r16lLzNga0=; b=nBZQcVxOTSamF0tgV7QfJIclbx2ZKDsao1s4MDDtUbhLaj8P9kRyLQ9PRD4uwPbr6P Ilxmpf1qGBURk68phKdQvzxQZYYU9ukALM0nE3yOy4p+y2cwLnP2IHcDB8fRri/KXO57 sqZ3voWNqbM4Ji5eXcOVOghWbMn+TxExbQ8zfSimByDD6tMLtKnKikiUusUGLgoRznII R6ZwHFNKcb+IsbjN1OJclZprFC2qv2MLd22Ej0odADmt/uugsn0fLe4VPr9SIXfaStNN c73jiUMQcbb1XEdOBdcTfxBMK5LXXTYgvFlSFbWIe79YUguacO8GWjxGwgJptCA3zTVD lF0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rzJ9J1wtHzrN/KosoPr/+d14bcRLxzvn6r16lLzNga0=; b=TefDZiJEHDJYQPLGrisWPd3buXekcKInmS166HwrC67im6HCFnOEmhtXhbchc6YYd0 00+P/bvmFoGHujCwBO1YSLaV3O7dRMxfew2b14Umy4foYWcnjuL4Fk3/ntWrtV1wBBAl B8yUIhs9PnsQY7MqbQXTM7iz2SM2z2gxZnN58pcUENuLrM9XfXk7Txp2/CH/VAlI2kvj nk6AaDjqAcx9cXRFIaTUSFAcVYuBQq+hdsafQpE4w1insEb2+zKs/6hOuXgW8uAl5fsf bNtbO6s6tYhTtYw4dIL/aeI15Qo5jY3A+Oe2J5+yPDs2WchLqKcZ4zHyN5gdZw6bLvja CDmg== X-Gm-Message-State: AGi0PuY02srbZL1VynXzVi8is26APfZis1vUwox+5ACL7q5F2nq1Bh7B g3fASZ2+N8DEjUJNx2gJOfbSwBTHw6I= X-Google-Smtp-Source: APiQypJxcWThnUqLbRSSSJcsznY3BVZEv/sX12T7J96XnZ6DwLGGUnOIEMtHgBORFimpppI9RTK7IA== X-Received: by 2002:a17:90a:d985:: with SMTP id d5mr5374423pjv.171.1587474762939; Tue, 21 Apr 2020 06:12:42 -0700 (PDT) Received: from konoha.iitr.ac.in ([103.37.201.175]) by smtp.gmail.com with ESMTPSA id g2sm2451492pjd.9.2020.04.21.06.12.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 06:12:42 -0700 (PDT) From: Shourya Shukla To: git@vger.kernel.org Cc: gitster@pobox.com, sandals@crustytoothpaste.net, Shourya Shukla Subject: [PATCH v3 4/4] gitfaq: fetching and pulling a repository Date: Tue, 21 Apr 2020 18:42:23 +0530 Message-Id: <20200421131223.29337-5-shouryashukla.oo@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200421131223.29337-1-shouryashukla.oo@gmail.com> References: <20200421131223.29337-1-shouryashukla.oo@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Add an issue in 'Common Issues' section which addresses the confusion between performing a 'fetch' and a 'pull'. Signed-off-by: Shourya Shukla --- Documentation/gitfaq.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt index cea293cf07..e93785f2f8 100644 --- a/Documentation/gitfaq.txt +++ b/Documentation/gitfaq.txt @@ -289,6 +289,26 @@ way of cloning it in lesser space?:: would mean fetching only the top level commits of the repository See linkgit:git-clone[1]. +[[fetching-and-pulling]] +How do I know if I want to do a fetch or a pull?:: + A fetch brings in the latest changes made upstream (i.e., the + remote repository we are working on). This allows us to inspect + the changes made upstream and integrate all those changes (if + and only if we want to) or only cherry pick certain changes. + Fetching does not have any immediate effects on the local + repository. + + A pull is a wrapper for a fetch and merge. This means that doing + a `git pull` will not only fetch the changes made upstream but + integrate them as well with our local repository. The merge may + go smoothly or have merge conflicts depending on the case. A pull + does not allow you to review any changes made upstream but rather + merge those changes on their own. ++ +This is the reason why it is sometimes advised to fetch the changes +first and then merge them accordingly because not every change might +be of utility to the user. + Hooks -----