{"thread":{"id":"54002","subject":"git bug","startedAt":"2020-08-06T17:34:25Z","lastAt":"2020-08-10T17:21:17Z","messageCount":5,"participants":["PANEL Christian","René Scharfe","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"403065","messageId":"1596725319.6764.7.camel@free.fr","threadId":"54002","inReplyTo":null,"subject":"git bug","fromName":"PANEL Christian","fromEmail":"ch.panel@free.fr","sentAt":"2020-08-06T14:48:39Z","receivedAt":"2020-08-06T17:34:25Z","isPatch":false,"sender":{"key":"ch.panel@free.fr","avatar":null},"body":"someting is not logical in the behaviour of git :\n\nsuppose I have a project and a file in it I don't want to include initially in.\nso I put this file name in .gitignore\nnow all is OK when I write \"git status\" : the file is ignored.\n\nbut later I want this one be a part of my project.\nI delete in .gitignore the line that named this file.\nbut now a \"git status\" command ignore always this file.\n\nwhat is wrong ?\ndid I missed something ?\n\nthanks for any answer \n"},{"id":"403094","messageId":"5387a5b7-4551-53a0-abdb-e26cc2702536@web.de","threadId":"54002","inReplyTo":"1596725319.6764.7.camel@free.fr","subject":"Re: git bug","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-08-06T20:23:54Z","receivedAt":"2020-08-06T20:24:20Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 06.08.20 um 16:48 schrieb PANEL Christian:\n> someting is not logical in the behaviour of git :\n>\n> suppose I have a project and a file in it I don't want to include initially in.\n> so I put this file name in .gitignore\n> now all is OK when I write \"git status\" : the file is ignored.\n\nLike this, right?\n\n  $ git init a\n  Initialized empty Git repository in /tmp/a/.git/\n  $ cd a\n  $ echo ignore for now >file\n  $ echo file >.gitignore\n  $ git add .gitignore\n  $ git commit -m initial\n  [master (root-commit) 2df5d68] initial\n   1 file changed, 1 insertion(+)\n   create mode 100644 .gitignore\n  $ git status\n  On branch master\n  nothing to commit, working tree clean\n\n> but later I want this one be a part of my project.\n> I delete in .gitignore the line that named this file.\n> but now a \"git status\" command ignore always this file.\n>\n> what is wrong ?\n> did I missed something ?\n\nThis seems to work as expected for me (continued from above):\n\n  $ >.gitignore\n  $ git status\n  On branch master\n  Changes not staged for commit:\n    (use \"git add <file>...\" to update what will be committed)\n    (use \"git restore <file>...\" to discard changes in working directory)\n  \tmodified:   .gitignore\n\n  Untracked files:\n    (use \"git add <file>...\" to include in what will be committed)\n  \tfile\n\n  no changes added to commit (use \"git add\" and/or \"git commit -a\")\n\nSo \"file\" is no longer ignored.  Committing the .gitignore change\ndoesn't change that:\n\n  $ git add .gitignore\n  $ git commit -m 2nd\n  [master d4c95a1] 2nd\n   1 file changed, 1 deletion(-)\n  $ git status\n  On branch master\n  Untracked files:\n    (use \"git add <file>...\" to include in what will be committed)\n  \tfile\n\n  nothing added to commit but untracked files present (use \"git add\" to track)\n\nWhich steps did you take to arrive at a different result?\n\nRené\n"},{"id":"403111","messageId":"20200807000226.GA12088@coredump.intra.peff.net","threadId":"54002","inReplyTo":"5387a5b7-4551-53a0-abdb-e26cc2702536@web.de","subject":"Re: git bug","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2020-08-07T00:02:26Z","receivedAt":"2020-08-07T03:09:29Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Aug 06, 2020 at 10:23:54PM +0200, René Scharfe wrote:\n\n> So \"file\" is no longer ignored.  Committing the .gitignore change\n> doesn't change that:\n> \n>   $ git add .gitignore\n>   $ git commit -m 2nd\n>   [master d4c95a1] 2nd\n>    1 file changed, 1 deletion(-)\n>   $ git status\n>   On branch master\n>   Untracked files:\n>     (use \"git add <file>...\" to include in what will be committed)\n>   \tfile\n> \n>   nothing added to commit but untracked files present (use \"git add\" to track)\n> \n> Which steps did you take to arrive at a different result?\n\nPerhaps also:\n\n  git check-ignore -v file\n\nwould be helpful for seeing why Git thinks it might be ignored (e.g.,\nanother wildcard rule that happens to match it).\n\n-Peff\n"},{"id":"403246","messageId":"c223cb39-501f-8ed1-9b82-2f7c2cb22886@web.de","threadId":"54002","inReplyTo":"20200807000226.GA12088@coredump.intra.peff.net","subject":"Re: git bug","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2020-08-10T05:56:13Z","receivedAt":"2020-08-10T05:56:29Z","isPatch":false,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 07.08.20 um 02:02 schrieb Jeff King:\n> On Thu, Aug 06, 2020 at 10:23:54PM +0200, René Scharfe wrote:\n>\n>> So \"file\" is no longer ignored.  Committing the .gitignore change\n>> doesn't change that:\n>>\n>>   $ git add .gitignore\n>>   $ git commit -m 2nd\n>>   [master d4c95a1] 2nd\n>>    1 file changed, 1 deletion(-)\n>>   $ git status\n>>   On branch master\n>>   Untracked files:\n>>     (use \"git add <file>...\" to include in what will be committed)\n>>   \tfile\n>>\n>>   nothing added to commit but untracked files present (use \"git add\" to track)\n>>\n>> Which steps did you take to arrive at a different result?\n>\n> Perhaps also:\n>\n>   git check-ignore -v file\n>\n> would be helpful for seeing why Git thinks it might be ignored (e.g.,\n> another wildcard rule that happens to match it).\n\nRight.  And there is more than one possible place to specify files to be\nignored.  E.g. you can use info/exclude in your Git directory (i.e.\n.git/info/exclude by default) for repository-specific patterns don't\nwant to share.  See https://git-scm.com/docs/gitignore or the manpage\nof gitignore(5) for more details.\n\nRené\n"},{"id":"403279","messageId":"1597080038.3096.1.camel@free.fr","threadId":"54002","inReplyTo":"c223cb39-501f-8ed1-9b82-2f7c2cb22886@web.de","subject":"Re: git bug","fromName":"PANEL Christian","fromEmail":"ch.panel@free.fr","sentAt":"2020-08-10T17:20:38Z","receivedAt":"2020-08-10T17:21:17Z","isPatch":false,"sender":{"key":"ch.panel@free.fr","avatar":null},"body":"thanks a lot.\nIt was exactly what I was seaching (and havent' read yet ;) )\n\nbest regards\n\nLe lundi 10 août 2020 à 07:56 +0200, René Scharfe a écrit :\n> Am 07.08.20 um 02:02 schrieb Jeff King:\n> > \n> > On Thu, Aug 06, 2020 at 10:23:54PM +0200, René Scharfe wrote:\n> > \n> > > \n> > > So \"file\" is no longer ignored.  Committing the .gitignore change\n> > > doesn't change that:\n> > > \n> > >   $ git add .gitignore\n> > >   $ git commit -m 2nd\n> > >   [master d4c95a1] 2nd\n> > >    1 file changed, 1 deletion(-)\n> > >   $ git status\n> > >   On branch master\n> > >   Untracked files:\n> > >     (use \"git add <file>...\" to include in what will be committed)\n> > >   \tfile\n> > > \n> > >   nothing added to commit but untracked files present (use \"git add\" to track)\n> > > \n> > > Which steps did you take to arrive at a different result?\n> > Perhaps also:\n> > \n> >   git check-ignore -v file\n> > \n> > would be helpful for seeing why Git thinks it might be ignored (e.g.,\n> > another wildcard rule that happens to match it).\n> Right.  And there is more than one possible place to specify files to be\n> ignored.  E.g. you can use info/exclude in your Git directory (i.e.\n> .git/info/exclude by default) for repository-specific patterns don't\n> want to share.  See https://git-scm.com/docs/gitignore or the manpage\n> of gitignore(5) for more details.\n> \n> René\n\n"}]}