{"thread":{"id":"63358","subject":"Probably typographic error in tutorial 2","startedAt":"2025-04-27T21:44:07Z","lastAt":"2025-04-28T18:37:08Z","messageCount":3,"participants":["el24614","Eric Sunshine","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"516867","messageId":"15509dd701ace6793f0ae19368e4c0c3@mail.ntua.gr","threadId":"63358","inReplyTo":null,"subject":"Probably typographic error in tutorial 2","fromName":"el24614","fromEmail":"el24614@mail.ntua.gr","sentAt":"2025-04-27T21:02:36Z","receivedAt":"2025-04-27T21:44:07Z","isPatch":false,"sender":{"key":"el24614@mail.ntua.gr","avatar":null},"body":"Hello,\n\nI think in tutorial  2 (https://git.scm.com/docs/gittutorial-2) in the \nfirst code box the second time that file.txt is edited ($ echo 'hello \nworld!' >file.txt) there should be an additional \">\" because a single \none will overwrite the contents. As far as i understand from what \nfollows bellow, the text should be appended.\n\nKind Regards,\nN.Antonetsis\n"},{"id":"516869","messageId":"CAPig+cSfbW9zG0Jv_t8QLFz6SPHFk=2g-eDirEpX8D0ytNWpXA@mail.gmail.com","threadId":"63358","inReplyTo":"15509dd701ace6793f0ae19368e4c0c3@mail.ntua.gr","subject":"Re: Probably typographic error in tutorial 2","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2025-04-27T21:54:35Z","receivedAt":"2025-04-27T21:54:51Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Apr 27, 2025 at 5:44 PM el24614 <el24614@mail.ntua.gr> wrote:\n> I think in tutorial  2 (https://git.scm.com/docs/gittutorial-2) in the\n> first code box the second time that file.txt is edited ($ echo 'hello\n> world!' >file.txt) there should be an additional \">\" because a single\n> one will overwrite the contents. As far as i understand from what\n> follows bellow, the text should be appended.\n\nPresumably you're talking about this example?\n\n    $ echo 'hello world' > file.txt\n    $ git add .\n    $ git commit -a -m \"initial commit\"\n    ...\n    $ echo 'hello world!' >file.txt\n    $ git commit -a -m \"add emphasis\"\n\nNote that the initial content of `file.txt` is \"hello world\", whereas\nthe updated content is \"hello world!\" with trailing exclamation point,\nso the content of the file does change (indeed, the commit message\n\"add emphasis\" hints at the way in which it changes). As such, the\nexample appears to be fine as-is and does not need to be changed to\nuse \">>\" instead of \">\".\n\nThat's not to say the example is ideal since the difference of \"!\" is\npotentially difficult to spot. Had it instead been:\n\n    $ echo 'HELLO WORLD' >file.txt\n\nor some other more obvious change, it probably would have been better.\nPlease feel free to submit a patch to improve the documentation if you\nthink such a change would help.\n"},{"id":"516903","messageId":"xmqqzfg0ceum.fsf@gitster.g","threadId":"63358","inReplyTo":"CAPig+cSfbW9zG0Jv_t8QLFz6SPHFk=2g-eDirEpX8D0ytNWpXA@mail.gmail.com","subject":"Re: Probably typographic error in tutorial 2","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-04-28T18:37:05Z","receivedAt":"2025-04-28T18:37:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> On Sun, Apr 27, 2025 at 5:44 PM el24614 <el24614@mail.ntua.gr> wrote:\n>> I think in tutorial  2 (https://git.scm.com/docs/gittutorial-2) in the\n>> first code box the second time that file.txt is edited ($ echo 'hello\n>> world!' >file.txt) there should be an additional \">\" because a single\n>> one will overwrite the contents. As far as i understand from what\n>> follows bellow, the text should be appended.\n>\n> Presumably you're talking about this example?\n>\n>     $ echo 'hello world' > file.txt\n>     $ git add .\n>     $ git commit -a -m \"initial commit\"\n>     ...\n>     $ echo 'hello world!' >file.txt\n>     $ git commit -a -m \"add emphasis\"\n>\n> Note that the initial content of `file.txt` is \"hello world\", whereas\n> the updated content is \"hello world!\" with trailing exclamation point,\n> so the content of the file does change (indeed, the commit message\n> \"add emphasis\" hints at the way in which it changes). As such, the\n> example appears to be fine as-is and does not need to be changed to\n> use \">>\" instead of \">\".\n>\n> That's not to say the example is ideal since the difference of \"!\" is\n> potentially difficult to spot. Had it instead been:\n>\n>     $ echo 'HELLO WORLD' >file.txt\n>\n> or some other more obvious change, it probably would have been better.\n> Please feel free to submit a patch to improve the documentation if you\n> think such a change would help.\n\nOr append \"Goodbye world\" to pair well with the first sentence?\n\nBy the way, I noticed that the URL given in the original post gives\na log-in page.  IT IS *NOT* the git-scm.com that is associated with\nthis project, but is somebody else.\n\nThe URL the original poster meant is probably\n\n    https://git-scm.com/docs/gittutorial-2\n\nI do not think the typo is malicious, though, and scm.com itself is\nrun by folks who have valid reasons to own the domain.\n\n"}]}