{"thread":{"id":"18139","subject":"ignored files stilll listed in git ls-files","startedAt":"2009-03-05T01:31:55Z","lastAt":"2009-03-06T14:31:46Z","messageCount":5,"participants":["David Shen","Boyd Stephen Smith Jr.","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"107016","messageId":"53e35fd50903041731v1a3c10c9sbb9295f322a819ce@mail.gmail.com","threadId":"18139","inReplyTo":null,"subject":"ignored files stilll listed in git ls-files","fromName":"David Shen","fromEmail":"davidshen84@googlemail.com","sentAt":"2009-03-05T01:31:55Z","receivedAt":"2009-03-05T01:31:55Z","isPatch":false,"sender":{"key":"davidshen84@googlemail.com","avatar":null},"body":"Hi,\n\nI add all the files to git before I learned the .gitignore file. Then\nI remove those unwanted files from the index. But those files still\nappear in git ls-files. This is really annoying. Is there any want to\nprevent those ignored files from git ls-files?\n\n\n--\nBest Regards,\nDavid Shen\n"},{"id":"107017","messageId":"200903041941.55693.bss@iguanasuicide.net","threadId":"18139","inReplyTo":"53e35fd50903041731v1a3c10c9sbb9295f322a819ce@mail.gmail.com","subject":"Re: ignored files stilll listed in git ls-files","fromName":"Boyd Stephen Smith Jr.","fromEmail":"bss@iguanasuicide.net","sentAt":"2009-03-05T01:41:55Z","receivedAt":"2009-03-05T01:41:55Z","isPatch":false,"sender":{"key":"bss@iguanasuicide.net","avatar":"https://gravatar.com/avatar/84b95eeff194b816c1568b1339e63e4b229825298664a9037b9f1ec713ead1e3?d=mp&s=160"},"body":"On Wednesday 04 March 2009 19:31:55 you wrote:\n> I add all the files to git before I learned the .gitignore file. Then\n> I remove those unwanted files from the index. But those files still\n> appear in git ls-files. This is really annoying. Is there any want to\n> prevent those ignored files from git ls-files?\n\ngit filter-branch\n-- \nBoyd Stephen Smith Jr.                   ,= ,-_-. =.\nbss@iguanasuicide.net                   ((_/)o o(\\_))\nICQ: 514984 YM/AIM: DaTwinkDaddy         `-'(. .)`-'\nhttp://iguanasuicide.net/                    \\_/\n\n"},{"id":"107036","messageId":"20090305090953.GB30445@coredump.intra.peff.net","threadId":"18139","inReplyTo":"53e35fd50903041731v1a3c10c9sbb9295f322a819ce@mail.gmail.com","subject":"Re: ignored files stilll listed in git ls-files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-05T09:09:54Z","receivedAt":"2009-03-05T09:09:54Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Mar 05, 2009 at 09:31:55AM +0800, David Shen wrote:\n\n> I add all the files to git before I learned the .gitignore file. Then\n> I remove those unwanted files from the index. But those files still\n> appear in git ls-files. This is really annoying. Is there any want to\n> prevent those ignored files from git ls-files?\n\nIf they are appearing in \"git ls-files\", then you didn't actually remove\nthem from the index. Can you show us exactly which commands you ran,\nwhat output they produced, and how it differs from what you expected?\n\n-Peff\n"},{"id":"107200","messageId":"53e35fd50903060602n2573217evcd48fdf822adf972@mail.gmail.com","threadId":"18139","inReplyTo":"20090305090953.GB30445@coredump.intra.peff.net","subject":"Re: ignored files stilll listed in git ls-files","fromName":"David Shen","fromEmail":"davidshen84@googlemail.com","sentAt":"2009-03-06T14:02:03Z","receivedAt":"2009-03-06T14:02:03Z","isPatch":false,"sender":{"key":"davidshen84@googlemail.com","avatar":null},"body":"Thanks for replying.\n\nMy command was not correct. And I solved my problem with the help from\nsomeone else.\n\nBut my problem is only solved on Linux. On my winodws machine, I have\nadded a lot of unwanted file to my git repo, before creating\n.gitignore file. I ran 'git rm --cached myfile' to remove it from the\nindex. But they still exist in 'git ls-files', because they exist in\nthe history. On Linux, I can use 'git filter-branch' to remove them\nfrom history. But, on windows,\n\nOn Thu, Mar 5, 2009 at 5:09 PM, Jeff King <peff@peff.net> wrote:\n> On Thu, Mar 05, 2009 at 09:31:55AM +0800, David Shen wrote:\n>\n>> I add all the files to git before I learned the .gitignore file. Then\n>> I remove those unwanted files from the index. But those files still\n>> appear in git ls-files. This is really annoying. Is there any want to\n>> prevent those ignored files from git ls-files?\n>\n> If they are appearing in \"git ls-files\", then you didn't actually remove\n> them from the index. Can you show us exactly which commands you ran,\n> what output they produced, and how it differs from what you expected?\n>\n> -Peff\n>\n\n\n\n-- \nBest Regards,\nDavid Shen\n"},{"id":"107202","messageId":"20090306143146.GA4001@coredump.intra.peff.net","threadId":"18139","inReplyTo":"53e35fd50903060602n2573217evcd48fdf822adf972@mail.gmail.com","subject":"Re: ignored files stilll listed in git ls-files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-06T14:31:46Z","receivedAt":"2009-03-06T14:31:46Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Mar 06, 2009 at 10:02:03PM +0800, David Shen wrote:\n\n> But my problem is only solved on Linux. On my winodws machine, I have\n> added a lot of unwanted file to my git repo, before creating\n> .gitignore file. I ran 'git rm --cached myfile' to remove it from the\n> index. But they still exist in 'git ls-files', because they exist in\n> the history. On Linux, I can use 'git filter-branch' to remove them\n> from history. But, on windows,\n\nI think filter-branch runs under cygwin (I think it might even run on\nmsysgit, but just hasn't been included in a shipped version yet). You\ncan also filter-branch on Linux and then fetch or clone the result to\nWindows.\n\n-Peff\n"}]}