{"thread":{"id":"32860","subject":"`git checkout --orpan` leaves a dirty worktree","startedAt":"2013-02-08T19:50:37Z","lastAt":"2013-02-10T20:10:45Z","messageCount":8,"participants":["Ramkumar Ramachandra","Jonathan Nieder","Junio C Hamano","Martin von Zweigbergk","Jens Lehmann"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"209027","messageId":"CALkWK0mjf5vsiHvMW-QyzMHdmZQvdzjw_ORJnMd=mT6RCqB1xg@mail.gmail.com","threadId":"32860","inReplyTo":null,"subject":"`git checkout --orpan` leaves a dirty worktree","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-02-08T19:50:37Z","receivedAt":"2013-02-08T19:50:37Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\nWhy should I have to `git rm -rf .` after a `git checkout --orphan`?\nWhat sort of misfeature/ incomplete feature is this?\n\nRam\n"},{"id":"209028","messageId":"20130208200402.GB8461@google.com","threadId":"32860","inReplyTo":"CALkWK0mjf5vsiHvMW-QyzMHdmZQvdzjw_ORJnMd=mT6RCqB1xg@mail.gmail.com","subject":"Re: `git checkout --orpan` leaves a dirty worktree","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-02-08T20:04:02Z","receivedAt":"2013-02-08T20:04:02Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Ramkumar Ramachandra wrote:\n\n> Why should I have to `git rm -rf .` after a `git checkout --orphan`?\n> What sort of misfeature/ incomplete feature is this?\n\nOne designed for the \"going open source\" use case, where you have\nexisting code that you want to put into a new branch without history.\nWhen there is no existing code, it seems simpler to do\n\n\tcd ..\n\tgit init code-that-has-nothing-to-do-previous-cwd\n\tcd code-that-*\n\t... hack hack hack ...\n\tgit commit\n\tgit remote add origin <url>\n\tgit push -u origin master\n\nBTW, I suspect a clearer way to say what you meant is \"Sounds like a\nmisfeature\" which is gentler and more focused than an implied \"What\nkind of idiot designed this?\"  Even if you are thinking the latter. :)\n\nHope that helps,\nJonathan\n"},{"id":"209031","messageId":"CALkWK0mdLabT7XyuYsDCROBC5FX+tDgyMnjMRbdkO41PTWd_Ug@mail.gmail.com","threadId":"32860","inReplyTo":"20130208200402.GB8461@google.com","subject":"Re: `git checkout --orpan` leaves a dirty worktree","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-02-08T20:11:20Z","receivedAt":"2013-02-08T20:11:20Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Jonathan Nieder wrote:\n> Ramkumar Ramachandra wrote:\n> One designed for the \"going open source\" use case, where you have\n> existing code that you want to put into a new branch without history.\n\n> BTW, I suspect a clearer way to say what you meant is \"Sounds like a\n> misfeature\" which is gentler and more focused than an implied \"What\n> kind of idiot designed this?\"  Even if you are thinking the latter. :)\n\nYes, I do feel stupid now.\n\nBTW, Is there a better way to clean out the worktree than `git rm -rf\n.`, since that fails for submodules?  The impulsive `reset --hard`\nobviously fails because there is no HEAD.\n\nThanks.\n"},{"id":"209032","messageId":"7vzjzezhrr.fsf@alter.siamese.dyndns.org","threadId":"32860","inReplyTo":"20130208200402.GB8461@google.com","subject":"Re: `git checkout --orpan` leaves a dirty worktree","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-08T20:12:56Z","receivedAt":"2013-02-08T20:12:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Ramkumar Ramachandra wrote:\n>\n>> Why should I have to `git rm -rf .` after a `git checkout --orphan`?\n>> What sort of misfeature/ incomplete feature is this?\n>\n> One designed for the \"going open source\" use case, where you have\n> existing code that you want to put into a new branch without history.\n> When there is no existing code, it seems simpler to do\n>\n> \tcd ..\n> \tgit init code-that-has-nothing-to-do-previous-cwd\n> \tcd code-that-*\n> \t... hack hack hack ...\n> \tgit commit\n> \tgit remote add origin <url>\n> \tgit push -u origin master\n>\n> BTW, I suspect a clearer way to say what you meant is \"Sounds like a\n> misfeature\" which is gentler and more focused than an implied \"What\n> kind of idiot designed this?\"  Even if you are thinking the latter. :)\n\nSo true ;-).  \n\nEspecially when you may an answer that may make _you_ look like an\nidiot ;-)\n"},{"id":"209033","messageId":"7vvca2zhkb.fsf@alter.siamese.dyndns.org","threadId":"32860","inReplyTo":"CALkWK0mdLabT7XyuYsDCROBC5FX+tDgyMnjMRbdkO41PTWd_Ug@mail.gmail.com","subject":"Re: `git checkout --orpan` leaves a dirty worktree","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-08T20:17:24Z","receivedAt":"2013-02-08T20:17:24Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramkumar Ramachandra <artagnon@gmail.com> writes:\n\n> BTW, Is there a better way to clean out the worktree than `git rm -rf\n> .`, since that fails for submodules?  The impulsive `reset --hard`\n> obviously fails because there is no HEAD.\n\nI _think_ the \"git rm\" is one of the things on Jens's roadmap.  Also\nI think \"reset --hard\" these days does know what to do when you do\nnot have any history yet.\n"},{"id":"209035","messageId":"CANiSa6hD=zX5=evziqQpXHdjUDEU80t_Du7L+Hpa11ru=5XVNQ@mail.gmail.com","threadId":"32860","inReplyTo":"CALkWK0mjf5vsiHvMW-QyzMHdmZQvdzjw_ORJnMd=mT6RCqB1xg@mail.gmail.com","subject":"Re: `git checkout --orpan` leaves a dirty worktree","fromName":"Martin von Zweigbergk","fromEmail":"martinvonz@gmail.com","sentAt":"2013-02-08T20:31:39Z","receivedAt":"2013-02-08T20:31:39Z","isPatch":false,"sender":{"key":"martinvonz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/891642?v=4"},"body":"I'm curious what your use case is.\n\nThe behavior has been inconvenient for me too, but I have only used it\nin test cases; I have no real use case where I wanted to create an\nunborn/orphan branch.\n\nOn Fri, Feb 8, 2013 at 11:50 AM, Ramkumar Ramachandra\n<artagnon@gmail.com> wrote:\n> Hi,\n>\n> Why should I have to `git rm -rf .` after a `git checkout --orphan`?\n> What sort of misfeature/ incomplete feature is this?\n>\n> Ram\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"},{"id":"209036","messageId":"CALkWK0mcOjbzCvzc-1W9RYM878Tiy8m20T41SdvqgY=qtE67rA@mail.gmail.com","threadId":"32860","inReplyTo":"CANiSa6hD=zX5=evziqQpXHdjUDEU80t_Du7L+Hpa11ru=5XVNQ@mail.gmail.com","subject":"Re: `git checkout --orpan` leaves a dirty worktree","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-02-08T20:38:36Z","receivedAt":"2013-02-08T20:38:36Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Martin von Zweigbergk wrote:\n> I'm curious what your use case is.\n\nA couple of them off the top of my head: the gh-pages branch in\nGitHub, restarting a project but keeping the old history around for\nreference.\n"},{"id":"209146","messageId":"5117FEC5.8080109@web.de","threadId":"32860","inReplyTo":"7vvca2zhkb.fsf@alter.siamese.dyndns.org","subject":"Re: `git checkout --orpan` leaves a dirty worktree","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2013-02-10T20:10:45Z","receivedAt":"2013-02-10T20:10:45Z","isPatch":false,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 08.02.2013 21:17, schrieb Junio C Hamano:\n> Ramkumar Ramachandra <artagnon@gmail.com> writes:\n> \n>> BTW, Is there a better way to clean out the worktree than `git rm -rf\n>> .`, since that fails for submodules?  The impulsive `reset --hard`\n>> obviously fails because there is no HEAD.\n> \n> I _think_ the \"git rm\" is one of the things on Jens's roadmap.\n\nHmm, \"git rm\" does remove submodules since 1.8.1 (but they have to be\ncloned with Git 1.7.8 or newer). Or is there something special about\nthe orphan checkout I'm missing here?\n"}]}