{"thread":{"id":"53385","subject":"[PATCH v5 1/4] gitfaq: files in .gitignore are tracked","startedAt":"2020-05-04T05:42:35Z","lastAt":"2020-05-04T17:11:48Z","messageCount":7,"participants":["Shourya Shukla","Junio C Hamano","Elijah Newren"],"isPatch":true,"patchVersion":5,"patchTotal":4},"messages":[{"id":"396883","messageId":"20200504054223.11125-1-shouryashukla.oo@gmail.com","threadId":"53385","inReplyTo":null,"subject":"[PATCH v5 1/4] gitfaq: files in .gitignore are tracked","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-05-04T05:42:20Z","receivedAt":"2020-05-04T05:42:35Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Add issue in 'Common Issues' section which addresses the problem of\nGit tracking files/paths mentioned in '.gitignore'.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\nThank you Junio and Elijah for the review! :)\nI have tried to make the solutions to the issues as concise and crisp\nas possible, linking the Documentation wherever necessary. Also, I have\nconverted 1SP -> 2 SP after full stops(.).\n\n Documentation/gitfaq.txt | 10 ++++++++++\n 1 file changed, 10 insertions(+)\n\ndiff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt\nindex 1cf83df118..11d9bac859 100644\n--- a/Documentation/gitfaq.txt\n+++ b/Documentation/gitfaq.txt\n@@ -223,6 +223,16 @@ a file checked into the repository which is a template or set of defaults which\n can then be copied alongside and modified as appropriate.  This second, modified\n file is usually ignored to prevent accidentally committing it.\n \n+[[files-in-.gitignore-are-tracked]]\n+I asked Git to ignore various files, yet they are still tracked::\n+\tA `gitignore` file ensures that certain file(s) which are not\n+\ttracked by Git remain untracked.  However, sometimes particular\n+\tfile(s) may have been tracked before adding them into the\n+\t`.gitignore`, hence they still remain tracked.  To untrack and\n+\tignore files/patterns, use `git rm --cached <file/pattern>`\n+\tand add a pattern to `.gitignore` that matches the <file>.\n+\tSee linkgit:gitignore[5] for details.\n+\n Hooks\n -----\n \n-- \n2.26.2\n\n"},{"id":"396885","messageId":"20200504054223.11125-2-shouryashukla.oo@gmail.com","threadId":"53385","inReplyTo":"20200504054223.11125-1-shouryashukla.oo@gmail.com","subject":"[PATCH v5 2/4] gitfaq: changing the remote of a repository","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-05-04T05:42:21Z","receivedAt":"2020-05-04T05:42:42Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Add issue in 'Common Issues' section which addresses the problem of\nchanging the remote of a repository, covering various cases in which\none might want to change the remote and the ways to do the same.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n Documentation/gitfaq.txt | 11 +++++++++++\n 1 file changed, 11 insertions(+)\n\ndiff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt\nindex 11d9bac859..875cfa0acd 100644\n--- a/Documentation/gitfaq.txt\n+++ b/Documentation/gitfaq.txt\n@@ -233,6 +233,17 @@ I asked Git to ignore various files, yet they are still tracked::\n \tand add a pattern to `.gitignore` that matches the <file>.\n \tSee linkgit:gitignore[5] for details.\n \n+[[changing-remote-of-the-repository]]\n+I want to change the remote of my repository. How do I do that?::\n+\tA remote is an identifier for a location to which Git pushes your\n+\tchanges as well as fetches any new changes from (if any).  There\n+\tmight be different circumstances in which one might need to change\n+\tthe remote URL (see linkgit:git-remote[1]).  To change the remote URL\n+\tone may use: git remote set-url <name> <newurl>\n++\n+One can list the remotes of a repository using `git remote -v` command.\n+The default name of a remote is 'origin'.\n+\n Hooks\n -----\n \n-- \n2.26.2\n\n"},{"id":"396884","messageId":"20200504054223.11125-3-shouryashukla.oo@gmail.com","threadId":"53385","inReplyTo":"20200504054223.11125-1-shouryashukla.oo@gmail.com","subject":"[PATCH v5 3/4] gitfaq: shallow cloning a repository","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-05-04T05:42:22Z","receivedAt":"2020-05-04T05:42:43Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Add issue in 'Common issue' section which covers issues with cloning\nlarge repositories. Use partial cloning to selectively clone the\nrepository.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\nI fixed the heading of this section and improved it overall though,\nas pointed out by Junio, there is a bit confusion as to what URL I\nam trying to point to:\nhttps://git-scm.com/docs/partial-clone\nThis is the URL I want to point to.\n\n Documentation/gitfaq.txt | 11 +++++++++++\n 1 file changed, 11 insertions(+)\n\ndiff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt\nindex 875cfa0acd..5dfbb32089 100644\n--- a/Documentation/gitfaq.txt\n+++ b/Documentation/gitfaq.txt\n@@ -244,6 +244,17 @@ I want to change the remote of my repository. How do I do that?::\n One can list the remotes of a repository using `git remote -v` command.\n The default name of a remote is 'origin'.\n \n+[[partial-cloning]]\n+The repository I am trying to clone is too big.  Is there an alternative\n+way of cloning it in lesser space?::\n+\tA good way to save space when cloning a repository is by using\n+\t`partial clones`.  A partial clone will clone the full history of\n+\tthe repository but will skip out the entities specified by the\n+\t`--filter` option one uses in `git clone`.  Any entity which has\n+\tnot been cloned to save space can be cloned\ton-demand (hence this\n+\tpresumes that the user has an always-on network connection to the\n+\toriginal repository).  See linkgit:partial-clone[1].\n+\n Hooks\n -----\n \n-- \n2.26.2\n\n"},{"id":"396886","messageId":"20200504054223.11125-4-shouryashukla.oo@gmail.com","threadId":"53385","inReplyTo":"20200504054223.11125-1-shouryashukla.oo@gmail.com","subject":"[PATCH v5 4/4] gitfaq: fetching and pulling a repository","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-05-04T05:42:23Z","receivedAt":"2020-05-04T05:42:51Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Add an issue in 'Common Issues' section which addresses the confusion\nbetween performing a 'fetch' and a 'pull'.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n Documentation/gitfaq.txt | 16 ++++++++++++++++\n 1 file changed, 16 insertions(+)\n\ndiff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt\nindex 5dfbb32089..04ea7be99f 100644\n--- a/Documentation/gitfaq.txt\n+++ b/Documentation/gitfaq.txt\n@@ -255,6 +255,22 @@ way of cloning it in lesser space?::\n \tpresumes that the user has an always-on network connection to the\n \toriginal repository).  See linkgit:partial-clone[1].\n \n+[[fetching-and-pulling]]\n+How do I know if I want to do a fetch or a pull?::\n+\tA fetch brings in the latest changes made upstream (i.e., the\n+\tremote repository we are working on) without modifying the current\n+\tbranch or the working tree.  This allows us to inspect\n+\tthe changes made upstream and integrate all those changes (if\n+\tand only if we want to) or only cherry pick certain changes.\n+\n+\tA pull is a wrapper for a fetch and merge/rebase.  This means that\n+\tdoing a `git pull` will not only fetch the changes made upstream\n+\tbut integrate them immediately with our current branch too.  The\n+\tmerge/rebase may go smoothly or have merge conflicts depending\n+\ton the case.  Hence, a pull does not give the user a chance to\n+\treview changes before applying them to their local repository/current\n+\tbranch.\n+\n Hooks\n -----\n \n-- \n2.26.2\n\n"},{"id":"396929","messageId":"xmqqimhbhcue.fsf@gitster.c.googlers.com","threadId":"53385","inReplyTo":"20200504054223.11125-1-shouryashukla.oo@gmail.com","subject":"Re: [PATCH v5 1/4] gitfaq: files in .gitignore are tracked","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-05-04T16:41:29Z","receivedAt":"2020-05-04T16:41:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shourya Shukla <shouryashukla.oo@gmail.com> writes:\n\n> Add issue in 'Common Issues' section which addresses the problem of\n> Git tracking files/paths mentioned in '.gitignore'.\n>\n> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n> ---\n> Thank you Junio and Elijah for the review! :)\n> I have tried to make the solutions to the issues as concise and crisp\n> as possible, linking the Documentation wherever necessary. Also, I have\n> converted 1SP -> 2 SP after full stops(.).\n\nIndeed I find it concise and very much to the point.  Looks quite\nwell written.\n\nThanks, will queue (and please ping me if I forget ;-))\n\n>\n>  Documentation/gitfaq.txt | 10 ++++++++++\n>  1 file changed, 10 insertions(+)\n>\n> diff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt\n> index 1cf83df118..11d9bac859 100644\n> --- a/Documentation/gitfaq.txt\n> +++ b/Documentation/gitfaq.txt\n> @@ -223,6 +223,16 @@ a file checked into the repository which is a template or set of defaults which\n>  can then be copied alongside and modified as appropriate.  This second, modified\n>  file is usually ignored to prevent accidentally committing it.\n>  \n> +[[files-in-.gitignore-are-tracked]]\n> +I asked Git to ignore various files, yet they are still tracked::\n> +\tA `gitignore` file ensures that certain file(s) which are not\n> +\ttracked by Git remain untracked.  However, sometimes particular\n> +\tfile(s) may have been tracked before adding them into the\n> +\t`.gitignore`, hence they still remain tracked.  To untrack and\n> +\tignore files/patterns, use `git rm --cached <file/pattern>`\n> +\tand add a pattern to `.gitignore` that matches the <file>.\n> +\tSee linkgit:gitignore[5] for details.\n> +\n>  Hooks\n>  -----\n"},{"id":"396930","messageId":"CABPp-BE7rk=B8a9GuZmtpnrdh7O1-=+zPPmgT1AHE2JgMq25Bw@mail.gmail.com","threadId":"53385","inReplyTo":"20200504054223.11125-4-shouryashukla.oo@gmail.com","subject":"Re: [PATCH v5 4/4] gitfaq: fetching and pulling a repository","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2020-05-04T16:42:38Z","receivedAt":"2020-05-04T16:42:52Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sun, May 3, 2020 at 10:42 PM Shourya Shukla\n<shouryashukla.oo@gmail.com> wrote:\n>\n> Add an issue in 'Common Issues' section which addresses the confusion\n> between performing a 'fetch' and a 'pull'.\n>\n> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n> ---\n>  Documentation/gitfaq.txt | 16 ++++++++++++++++\n>  1 file changed, 16 insertions(+)\n>\n> diff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt\n> index 5dfbb32089..04ea7be99f 100644\n> --- a/Documentation/gitfaq.txt\n> +++ b/Documentation/gitfaq.txt\n> @@ -255,6 +255,22 @@ way of cloning it in lesser space?::\n>         presumes that the user has an always-on network connection to the\n>         original repository).  See linkgit:partial-clone[1].\n>\n> +[[fetching-and-pulling]]\n> +How do I know if I want to do a fetch or a pull?::\n> +       A fetch brings in the latest changes made upstream (i.e., the\n> +       remote repository we are working on) without modifying the current\n> +       branch or the working tree.  This allows us to inspect\n> +       the changes made upstream and integrate all those changes (if\n> +       and only if we want to) or only cherry pick certain changes.\n> +\n> +       A pull is a wrapper for a fetch and merge/rebase.  This means that\n> +       doing a `git pull` will not only fetch the changes made upstream\n> +       but integrate them immediately with our current branch too.  The\n> +       merge/rebase may go smoothly or have merge conflicts depending\n> +       on the case.  Hence, a pull does not give the user a chance to\n> +       review changes before applying them to their local repository/current\n> +       branch.\n> +\n\nSo a few issues; elsewhere in this thread, Junio said:\n\n    We should strive to (1) make sure any FAQ entry can have a pointer\n    to more comprehensive and canonical documentation, and (2) an FAQ\n    entry with such a pointer does not consume more than one paragraph,\n    say no more than 5 lines.\n\n* This answer is multiple paragraphs and 12 lines.\n* The answer is fairly repetitive (e.g. why add \"if and only if we\nwant to\"; isn't that already covered by \"allows us to\"?).  You also\nbring up inspecting/reviewing the changes multiple times.\n* This brings up cherry-picking in a really awkward way that seems to\nbe suggesting or at least condoning what sounds like a very broken\nworkflow.  (If it's your upstream, why are you only cherry-picking\nchanges from it?  You're going to get divergent history and the next\nmerge will end up with multiple copies of the commits.  If it's\nsomething you only cherry-pick from, it sounds like it isn't intended\nto be an upstream but something else.)\n* This side-tracks into the results of a merge or rebase; why do we\nneed to mention that it can go smoothly or have conflicts at this\npoint?\n\n\nHow about the five line version I suggested earlier:\n\nA fetch stores a copy of the latest changes from the remote\nrepository, without modifying the working tree or current branch.  You\ncan then at your leisure inspect, merge, rebase on top of, or ignore\nthe upstream changes.  A pull consists of a fetch followed immediately\nby either a merge or rebase.\n\nYou could optionally also add a link to the git-pull documentation\n(which incidentally also answers the original question in the first\nfour sentences of its description).\n"},{"id":"396934","messageId":"CABPp-BGYh7-kq+J3TZNhfraouNfkj6u_YLaEwD_zUihBae0DUw@mail.gmail.com","threadId":"53385","inReplyTo":"20200504054223.11125-3-shouryashukla.oo@gmail.com","subject":"Re: [PATCH v5 3/4] gitfaq: shallow cloning a repository","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2020-05-04T17:11:34Z","receivedAt":"2020-05-04T17:11:48Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Sun, May 3, 2020 at 10:42 PM Shourya Shukla\n<shouryashukla.oo@gmail.com> wrote:\n> Subject: [PATCH v5 3/4] gitfaq: shallow cloning a repository\n\nShouldn't the subject be updated as well, since we're talking about\npartial clones rather than shallow clones?\n\n> Add issue in 'Common issue' section which covers issues with cloning\n> large repositories. Use partial cloning to selectively clone the\n> repository.\n>\n> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n> ---\n> I fixed the heading of this section and improved it overall though,\n> as pointed out by Junio, there is a bit confusion as to what URL I\n> am trying to point to:\n> https://git-scm.com/docs/partial-clone\n> This is the URL I want to point to.\n>\n>  Documentation/gitfaq.txt | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n>\n> diff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt\n> index 875cfa0acd..5dfbb32089 100644\n> --- a/Documentation/gitfaq.txt\n> +++ b/Documentation/gitfaq.txt\n> @@ -244,6 +244,17 @@ I want to change the remote of my repository. How do I do that?::\n>  One can list the remotes of a repository using `git remote -v` command.\n>  The default name of a remote is 'origin'.\n>\n> +[[partial-cloning]]\n> +The repository I am trying to clone is too big.  Is there an alternative\n> +way of cloning it in lesser space?::\n> +       A good way to save space when cloning a repository is by using\n> +       `partial clones`.  A partial clone will clone the full history of\n> +       the repository but will skip out the entities specified by the\n> +       `--filter` option one uses in `git clone`.  Any entity which has\n> +       not been cloned to save space can be cloned     on-demand (hence this\n> +       presumes that the user has an always-on network connection to the\n> +       original repository).  See linkgit:partial-clone[1].\n> +\n>  Hooks\n>  -----\n>\n> --\n> 2.26.2\n>\n"}]}