{"thread":{"id":"53272","subject":"[PATCH v3 0/4] gitfaq: add issues in the 'Common Issues' section","startedAt":"2020-04-21T13:11:26Z","lastAt":"2020-04-21T13:11:35Z","messageCount":4,"participants":["Shourya Shukla"],"isPatch":true,"patchVersion":3,"patchTotal":4},"messages":[{"id":"395823","messageId":"20200421131111.29201-1-shouryashukla.oo@gmail.com","threadId":"53272","inReplyTo":null,"subject":"[PATCH v3 0/4] gitfaq: add issues in the 'Common Issues' section","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-04-21T13:11:08Z","receivedAt":"2020-04-21T13:11:26Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"This is the third version of addition of issues in the 'Common Issues' section.\nIn this version I have:\n\t1. Changed column wrapping from 90 col. to ~70 col.\n\t2. Removed the issues: 'rebasing-and-merging' & 'checking-out'\n\t3. Added issue: 'shallow-cloning'\n\t4. Separated the issues in individual commits.\n\t5. Corrected spelling and grammatical mistakes.\n\nI decided to drop the issues mentioned in (2) because of the lack of clarity\nin them. As Junio advised, it would be better to improve their respective\ndocumentations rather than adding them in the FAQ.\n\nI really appreciate Junio and Brian for reviewing my patch in such great detail :)\n\nRegards,\nShourya Shukla\n\nShourya Shukla (4):\n  gitfaq: files in .gitignore are tracked\n  gitfaq: changing the remote of a repository\n  gitfaq: shallow cloning a repository\n  gitfaq: fetching and pulling a repository\n\n Documentation/gitfaq.txt | 86 ++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 86 insertions(+)\n\n-- \n2.20.1\n\n"},{"id":"395824","messageId":"20200421131111.29201-2-shouryashukla.oo@gmail.com","threadId":"53272","inReplyTo":"20200421131111.29201-1-shouryashukla.oo@gmail.com","subject":"[PATCH v3 1/4] gitfaq: files in .gitignore are tracked","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-04-21T13:11:09Z","receivedAt":"2020-04-21T13:11:29Z","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---\n Documentation/gitfaq.txt | 21 +++++++++++++++++++++\n 1 file changed, 21 insertions(+)\n\ndiff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt\nindex 1cf83df118..96767e7c75 100644\n--- a/Documentation/gitfaq.txt\n+++ b/Documentation/gitfaq.txt\n@@ -223,6 +223,27 @@ 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+\tGit ignores files matching the patterns stated in the '.gitignore'.\n+\tConsequently, `git add` does not add the files/paths matching the\n+\tpattern in `.gitignore`, meaning they remain untracked; `git status`\n+\tdoes not list the aforementioned files/paths as untracked.\n+\n+\tOne thing to note is that the `.gitignore` mechanism applies only\n+\tto the files that are not already tracked. A file/path that is\n+\talready tracked will stay to be tracked even if you add a pattern\n+\tthat happens to match it to `.gitignore` file.\n+\n+\tThis is probably the reason why Git shows some files/paths in the\n+\tstaging area. These entities were being tracked before and later\n+\twere added in the `.gitignore`, due to which they show up in the\n+\tstaging area.\n+\n+\tTo completely ignore and untrack files/paths falling in the above\n+\tcategory, it is advised to use `git rm --cached <file>` as well as\n+\tadd these files/paths in the `.gitignore`.\n+\n Hooks\n -----\n \n-- \n2.20.1\n\n"},{"id":"395825","messageId":"20200421131111.29201-3-shouryashukla.oo@gmail.com","threadId":"53272","inReplyTo":"20200421131111.29201-1-shouryashukla.oo@gmail.com","subject":"[PATCH v3 2/4] gitfaq: changing the remote of a repository","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-04-21T13:11:10Z","receivedAt":"2020-04-21T13:11:32Z","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 | 31 +++++++++++++++++++++++++++++++\n 1 file changed, 31 insertions(+)\n\ndiff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt\nindex 96767e7c75..13d37f96af 100644\n--- a/Documentation/gitfaq.txt\n+++ b/Documentation/gitfaq.txt\n@@ -244,6 +244,37 @@ I asked Git to ignore various files, yet they are still tracked::\n \tcategory, it is advised to use `git rm --cached <file>` as well as\n \tadd these files/paths in the `.gitignore`.\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:\n+\n+\t\t1. One might want to update the URL of their remote; in that\n+\t\t   case, the command to use is, `git remote set-url <name> <newurl>`.\n+\n+\t\t2. One might want to have two different remotes for fetching\n+\t\t   and pushing; this generally happens in case of triangular\n+\t\t   workflows: one fetches from one repository and pushes to\n+\t\t   another. In this case, it is advisable to have separate\n+\t\t   remotes for fetching and pushing. But, another way can be\n+\t\t   to change the push URL using the `--push` option in the\n+\t\t   `git set-url` command.\n+\n+\t\t3. One might want to push changes to a network protocol\n+\t\t   different from the one they fetch from. For instance,\n+\t\t   one may be using an unauthenticated http:// URL for\n+\t\t   fetching from a repository and use an ssh:// URL when\n+\t\t   you push via the same remote. In such a case, one can\n+\t\t   change the 'push' URL of the same remote using the `--push`\n+\t\t   option in `git remote set-url`. Now, the same remote will\n+\t\t   have two different kinds of URLs (http and ssh) for fetching\n+\t\t   and pulling.\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.20.1\n\n"},{"id":"395826","messageId":"20200421131111.29201-4-shouryashukla.oo@gmail.com","threadId":"53272","inReplyTo":"20200421131111.29201-1-shouryashukla.oo@gmail.com","subject":"[PATCH v3 4/4] gitfaq: fetching and pulling a repository","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-04-21T13:11:11Z","receivedAt":"2020-04-21T13:11:35Z","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 | 20 ++++++++++++++++++++\n 1 file changed, 20 insertions(+)\n\ndiff --git a/Documentation/gitfaq.txt b/Documentation/gitfaq.txt\nindex cea293cf07..e93785f2f8 100644\n--- a/Documentation/gitfaq.txt\n+++ b/Documentation/gitfaq.txt\n@@ -289,6 +289,26 @@ way of cloning it in lesser space?::\n \twould mean fetching only the top level commits of the repository\n \tSee linkgit:git-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). 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+\tFetching does not have any immediate effects on the local\n+\trepository.\n+\n+\tA pull is a wrapper for a fetch and merge. This means that doing\n+\ta `git pull` will not only fetch the changes made upstream but\n+\tintegrate them as well with our local repository. The merge may\n+\tgo smoothly or have merge conflicts depending on the case. A pull\n+\tdoes not allow you to review any changes made upstream but rather\n+\tmerge those changes on their own.\n++\n+This is the reason why it is sometimes advised to fetch the changes\n+first and then merge them accordingly because not every change might\n+be of utility to the user.\n+\n Hooks\n -----\n \n-- \n2.20.1\n\n"}]}