{"thread":{"id":"21243","subject":"why no \"ignore\" command on git","startedAt":"2009-10-14T22:35:23Z","lastAt":"2009-10-15T15:52:20Z","messageCount":6,"participants":["Ralf Thielow","Scott Wiersdorf","Wesley J. Landaker","Johannes Schindelin","Matthieu Moy","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"125029","messageId":"42efdea40910141535g23a50b87p9b6c4a0fde7e842e@mail.gmail.com","threadId":"21243","inReplyTo":null,"subject":"why no \"ignore\" command on git","fromName":"Ralf Thielow","fromEmail":"ralf.thielow@googlemail.com","sentAt":"2009-10-14T22:35:23Z","receivedAt":"2009-10-14T22:35:23Z","isPatch":false,"sender":{"key":"ralf.thielow@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1275832?v=4"},"body":"Hello,\n\nwhy does git don't have an \"ignore\" command, to ignore some files or\ndirectories all the time.\nIn many project file structures you have IDE specified project files\nor directories which\nshould not be tracked on git. All the time git says that you can add\nthese files, this is not\nusable if you want to add many files with the \"git add .\" command.\nI read on some pages by a google search that you can create\na \".gitignore\" directory or something like that. But you had to do\nthis manually.\n\nwhy there is no \"ignore\" command on git?\n\nbest regards\n\nRalf\n"},{"id":"125031","messageId":"20091014230217.GA87543@perlcode.org","threadId":"21243","inReplyTo":"42efdea40910141535g23a50b87p9b6c4a0fde7e842e@mail.gmail.com","subject":"Re: why no \"ignore\" command on git","fromName":"Scott Wiersdorf","fromEmail":"scott@perlcode.org","sentAt":"2009-10-14T23:02:17Z","receivedAt":"2009-10-14T23:02:17Z","isPatch":false,"sender":{"key":"scott@perlcode.org","avatar":null},"body":"git does have a command to ignore files and directories: it's called\n'emacs' (or 'vim' on some systems).\n\nSeriously, the .gitignore file can contain a complex set of patterns\nto ignore, and you can have .gitignore files at lower directories in a\nhierarchy to override higher ones. This isn't something easily\ncontained in a simple command.\n\nScott\n\n\nOn Thu, Oct 15, 2009 at 12:35:23AM +0200, Ralf Thielow wrote:\n> Hello,\n> \n> why does git don't have an \"ignore\" command, to ignore some files or\n> directories all the time.\n> In many project file structures you have IDE specified project files\n> or directories which\n> should not be tracked on git. All the time git says that you can add\n> these files, this is not\n> usable if you want to add many files with the \"git add .\" command.\n> I read on some pages by a google search that you can create\n> a \".gitignore\" directory or something like that. But you had to do\n> this manually.\n> \n> why there is no \"ignore\" command on git?\n> \n> best regards\n> \n> Ralf\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n\n-- \nScott Wiersdorf\n<scott@perlcode.org>\n"},{"id":"125058","messageId":"200910142220.51725.wjl@icecavern.net","threadId":"21243","inReplyTo":"42efdea40910141535g23a50b87p9b6c4a0fde7e842e@mail.gmail.com","subject":"Re: why no \"ignore\" command on git","fromName":"Wesley J. Landaker","fromEmail":"wjl@icecavern.net","sentAt":"2009-10-15T04:20:50Z","receivedAt":"2009-10-15T04:20:50Z","isPatch":false,"sender":{"key":"wjl@icecavern.net","avatar":"https://avatars.githubusercontent.com/u/67229?v=4"},"body":"On Wednesday 14 October 2009 16:35:23 Ralf Thielow wrote:\n> why does git don't have an \"ignore\" command, to ignore some files or\n> directories all the time.\n[...]\n> I read on some pages by a google search that you can create\n> a \".gitignore\" directory or something like that. But you had to do\n> this manually.\n>\n> why there is no \"ignore\" command on git?\n\nYou could always make your own git-ignore script, e.g.:\n\n#!/bin/sh\necho \"$@\" >> .gitignore\n"},{"id":"125066","messageId":"alpine.DEB.1.00.0910151125240.4985@pacific.mpi-cbg.de","threadId":"21243","inReplyTo":"200910142220.51725.wjl@icecavern.net","subject":"Re: why no \"ignore\" command on git","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-10-15T09:29:57Z","receivedAt":"2009-10-15T09:29:57Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 14 Oct 2009, Wesley J. Landaker wrote:\n\n> On Wednesday 14 October 2009 16:35:23 Ralf Thielow wrote:\n> > why does git don't have an \"ignore\" command, to ignore some files or\n> > directories all the time.\n> [...]\n> > I read on some pages by a google search that you can create\n> > a \".gitignore\" directory or something like that. But you had to do\n> > this manually.\n> >\n> > why there is no \"ignore\" command on git?\n> \n> You could always make your own git-ignore script, e.g.:\n> \n> #!/bin/sh\n> echo \"$@\" >> .gitignore\n\nProbably it needs to be a little more sophisticated, because of Postel's \nlaw.\n\n#!/bin/sh\n\ngit rev-parse > /dev/null || exit\nfor f\ndo\n\tcase \"$f\" in\n\t*'[*?]'*)\n\t\t# patterns probably are meant to be recursive\n\t\techo \"$f\"\n\t\t;;\n\t*)\n\t\techo /\"$f\"\n\t\t;;\n\tesac >> .gitignore\ndone\ngit add .gitignore\n\n\nCiao,\nDscho\n"},{"id":"125070","messageId":"vpqaazsrj0q.fsf@bauges.imag.fr","threadId":"21243","inReplyTo":"200910142220.51725.wjl@icecavern.net","subject":"Re: why no \"ignore\" command on git","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2009-10-15T11:31:01Z","receivedAt":"2009-10-15T11:31:01Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"\"Wesley J. Landaker\" <wjl@icecavern.net> writes:\n\n> On Wednesday 14 October 2009 16:35:23 Ralf Thielow wrote:\n>> why does git don't have an \"ignore\" command, to ignore some files or\n>> directories all the time.\n> [...]\n>> I read on some pages by a google search that you can create\n>> a \".gitignore\" directory or something like that. But you had to do\n>> this manually.\n>>\n>> why there is no \"ignore\" command on git?\n>\n> You could always make your own git-ignore script, e.g.:\n>\n> #!/bin/sh\n> echo \"$@\" >> .gitignore\n\nSure. OTOH, there are other interesting things a \"ignore\" command can\ndo. bzr, for example, has a \"bzr ignore\" command that can either add\nstuff to your .bzrignore, or tell you which pattern cause which file\nto be ignored. That's handy sometimes.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"125080","messageId":"20091015155220.GA12169@coredump.intra.peff.net","threadId":"21243","inReplyTo":"vpqaazsrj0q.fsf@bauges.imag.fr","subject":"Re: why no \"ignore\" command on git","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-10-15T15:52:20Z","receivedAt":"2009-10-15T15:52:20Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Oct 15, 2009 at 01:31:01PM +0200, Matthieu Moy wrote:\n\n> >> why there is no \"ignore\" command on git?\n> >\n> > You could always make your own git-ignore script, e.g.:\n> >\n> > #!/bin/sh\n> > echo \"$@\" >> .gitignore\n> \n> Sure. OTOH, there are other interesting things a \"ignore\" command can\n> do. bzr, for example, has a \"bzr ignore\" command that can either add\n> stuff to your .bzrignore, or tell you which pattern cause which file\n> to be ignored. That's handy sometimes.\n\nI wrote a toy patch that did something like that a while ago:\n\n  http://thread.gmane.org/gmane.comp.version-control.git/108671/focus=108842\n\nI don't think there is any reason such a thing could not be included\nwith git (if it did something more interesting than just echoing its\narguments to .gitignore), but nobody has felt strongly enough about it\nyet to actually write something polished.\n\n-Peff\n"}]}