{"thread":{"id":"30864","subject":"git bisect/checkout and changes to .gitignore","startedAt":"2012-06-22T07:51:00Z","lastAt":"2012-06-22T17:42:44Z","messageCount":4,"participants":["Chris Angelico","Johannes Sixt","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"194055","messageId":"CAPTjJmq4zv6dBR2Z-HfM7CJoxfprSdJEYYELuyBfahw2PkZ4Lw@mail.gmail.com","threadId":"30864","inReplyTo":null,"subject":"git bisect/checkout and changes to .gitignore","fromName":"Chris Angelico","fromEmail":"rosuav@gmail.com","sentAt":"2012-06-22T07:51:00Z","receivedAt":"2012-06-22T07:51:00Z","isPatch":false,"sender":{"key":"rosuav@gmail.com","avatar":"https://avatars.githubusercontent.com/u/640535?v=4"},"body":"Greetings! I'm not certain if this list or the git-users group is more\nappropriate; my apologies if I've picked wrong.\n\nAt my workplace we use git to manage all of our source code. Every now\nand then, we decide that some particular file oughtn't to be\ngit-managed, and add it into .gitignore and remove it from the\nrepository (for instance, configuration files that become\nper-developer).\n\nIs there a way to checkout an old version of the repository (before\nthe file was added to .gitignore), then return to the current state,\nwithout destroying these sorts of files? Currently, checking out the\nold version quietly \"takes control\" of the file, and then checking out\na newer one deletes it.\n\nI've read through the man pages for 'git checkout' and 'gitignore' and\nsearched the one for 'git config' (it's a little large to read all\nof), without seeing an option to preserve files on checkout. Is there\na way to do this, and if so, where can I find it?\n\nThanks in advance!\n\nChris Angelico\n"},{"id":"194066","messageId":"4FE44983.30209@viscovery.net","threadId":"30864","inReplyTo":"CAPTjJmq4zv6dBR2Z-HfM7CJoxfprSdJEYYELuyBfahw2PkZ4Lw@mail.gmail.com","subject":"Re: git bisect/checkout and changes to .gitignore","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2012-06-22T10:31:31Z","receivedAt":"2012-06-22T10:31:31Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 6/22/2012 9:51, schrieb Chris Angelico:\n> At my workplace we use git to manage all of our source code. Every now\n> and then, we decide that some particular file oughtn't to be\n> git-managed, and add it into .gitignore and remove it from the\n> repository (for instance, configuration files that become\n> per-developer).\n> \n> Is there a way to checkout an old version of the repository (before\n> the file was added to .gitignore), then return to the current state,\n> without destroying these sorts of files? Currently, checking out the\n> old version quietly \"takes control\" of the file, and then checking out\n> a newer one deletes it.\n> \n> I've read through the man pages for 'git checkout' and 'gitignore' and\n> searched the one for 'git config' (it's a little large to read all\n> of), without seeing an option to preserve files on checkout. Is there\n> a way to do this, and if so, where can I find it?\n\nFiles mentioned in .gitignore are considered garbage. But your file is\nprecious, hence, you should not list it in .gitignore.\n\nHere is a thread that is worthwhile to read. I posted a patch\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/185724/focus=185733\n\nbut it was dismissed, see\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/185724/focus=185746\n\n-- Hannes\n"},{"id":"194067","messageId":"CAPTjJmqw6hC_SnWiNOfcebzu4ywWkvLNOG8pbi_D+rBnQYenMw@mail.gmail.com","threadId":"30864","inReplyTo":"4FE44983.30209@viscovery.net","subject":"Re: git bisect/checkout and changes to .gitignore","fromName":"Chris Angelico","fromEmail":"rosuav@gmail.com","sentAt":"2012-06-22T12:07:52Z","receivedAt":"2012-06-22T12:07:52Z","isPatch":false,"sender":{"key":"rosuav@gmail.com","avatar":"https://avatars.githubusercontent.com/u/640535?v=4"},"body":"On Fri, Jun 22, 2012 at 8:31 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Files mentioned in .gitignore are considered garbage. But your file is\n> precious, hence, you should not list it in .gitignore.\n\nAn important distinction! Thanks for the thread pointer.\n\nThe --no-overwrite-ignore flag is part of what I want. It at least\ngives protection against accidentally losing things (on Wednesday, I\nunwittingly disposed of several large binary files, and didn't even\nknow about it until a chance discovery of directory size). Is there a\nway to specify that this flag always be used, even when the checkout\ndoesn't happen on the command line but through (eg) git bisect?\n\nChris Angelico\n"},{"id":"194080","messageId":"7vbokbqm3v.fsf@alter.siamese.dyndns.org","threadId":"30864","inReplyTo":"4FE44983.30209@viscovery.net","subject":"Re: git bisect/checkout and changes to .gitignore","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-06-22T17:42:44Z","receivedAt":"2012-06-22T17:42:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> Here is a thread that is worthwhile to read. I posted a patch\n>\n> http://thread.gmane.org/gmane.comp.version-control.git/185724/focus=185733\n>\n> but it was dismissed, see\n>\n> http://thread.gmane.org/gmane.comp.version-control.git/185724/focus=185746\n\nThanks.\n\nTwo thoughts and a half.\n\n - For people who do not want to read the above, the patch in the\n   former was not a change to the code, but was a demonstration to\n   exploit a bug in .git/ignore/exclude handling.\n\n - The latter message above outlined a future direction to properly\n   handle \"ignored\" vs \"precious\" distinction.\n\n - There probably are other \"here is a way forward\" messages in the\n   list archive whose visions haven't been materialized. Is anybody\n   collecting these? I suspect that such a collection would be far\n   more useful than a typical bug tracker that nobody looks at.\n"}]}