{"thread":{"id":"23338","subject":"Mysterious junk in file.... \"not commited yet\"","startedAt":"2010-04-05T18:13:46Z","lastAt":"2010-04-05T19:29:29Z","messageCount":6,"participants":["Howard Miller","Avery Pennarun","Matthieu Moy"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"138607","messageId":"i2v26ae428a1004051113q68a0cf13o65fbf1349f941648@mail.gmail.com","threadId":"23338","inReplyTo":null,"subject":"Mysterious junk in file.... \"not commited yet\"","fromName":"Howard Miller","fromEmail":"howard@e-learndesign.co.uk","sentAt":"2010-04-05T18:13:46Z","receivedAt":"2010-04-05T18:13:46Z","isPatch":false,"sender":{"key":"howard@e-learndesign.co.uk","avatar":"https://gravatar.com/avatar/ddb66c6a4a077e52b823ac5b04f33ab927cb90e2ab1eafedaeba07b1920bb99e?d=mp&s=160"},"body":"Hi,\n\nI just found a file in my project that has \"junk\" at the beginning\n(looks like some binary stuff at the start of a php file). Git status\nand diff show nothing unusual (nothing to commit). Git log shows\nnothing I wouldn't expect and show 'shows' show noting. Git blame on\nthe other shows the offending line as 'not commited yet'. I tried\ndoing 'git checkout <filename>' but it didn't fix it.\n\nWhat am I missing? Has git broken somewhere?\n\nThanks,\n\nHoward\n"},{"id":"138655","messageId":"o2n32541b131004051152ie6c82b3wdab0f38a9e657943@mail.gmail.com","threadId":"23338","inReplyTo":"i2v26ae428a1004051113q68a0cf13o65fbf1349f941648@mail.gmail.com","subject":"Re: Mysterious junk in file.... \"not commited yet\"","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-04-05T18:52:26Z","receivedAt":"2010-04-05T18:52:26Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Mon, Apr 5, 2010 at 2:13 PM, Howard Miller\n<howard@e-learndesign.co.uk> wrote:\n> I just found a file in my project that has \"junk\" at the beginning\n> (looks like some binary stuff at the start of a php file). Git status\n> and diff show nothing unusual (nothing to commit). Git log shows\n> nothing I wouldn't expect and show 'shows' show noting. Git blame on\n> the other shows the offending line as 'not commited yet'. I tried\n> doing 'git checkout <filename>' but it didn't fix it.\n>\n> What am I missing? Has git broken somewhere?\n\nYou might have 'git add'ed the changed line.  Try this:\n\n   git checkout HEAD -- <filename>\n\nHave fun,\n\nAvery\n"},{"id":"138658","messageId":"p2y26ae428a1004051203jbb7c838eh8de0cb5f6ae1dcb1@mail.gmail.com","threadId":"23338","inReplyTo":"o2n32541b131004051152ie6c82b3wdab0f38a9e657943@mail.gmail.com","subject":"Re: Mysterious junk in file.... \"not commited yet\"","fromName":"Howard Miller","fromEmail":"howard@e-learndesign.co.uk","sentAt":"2010-04-05T19:03:11Z","receivedAt":"2010-04-05T19:03:11Z","isPatch":false,"sender":{"key":"howard@e-learndesign.co.uk","avatar":"https://gravatar.com/avatar/ddb66c6a4a077e52b823ac5b04f33ab927cb90e2ab1eafedaeba07b1920bb99e?d=mp&s=160"},"body":">\n> You might have 'git add'ed the changed line.  Try this:\n>\n>   git checkout HEAD -- <filename>\n>\n> Have fun,\n>\n> Avery\n>\n\nHmmm... fixed. I've never even heard of 'git add' before. Why is this\ndifferent to plain old 'checkout' without the HEAD?\n\nAnyway... thanks. Day saved :)\n"},{"id":"138659","messageId":"n2g32541b131004051213q17f9e948m5f02a3575fb0f1f1@mail.gmail.com","threadId":"23338","inReplyTo":"p2y26ae428a1004051203jbb7c838eh8de0cb5f6ae1dcb1@mail.gmail.com","subject":"Re: Mysterious junk in file.... \"not commited yet\"","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2010-04-05T19:13:49Z","receivedAt":"2010-04-05T19:13:49Z","isPatch":false,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On Mon, Apr 5, 2010 at 3:03 PM, Howard Miller\n<howard@e-learndesign.co.uk> wrote:\n>> You might have 'git add'ed the changed line.  Try this:\n>>\n>>   git checkout HEAD -- <filename>\n>\n> Hmmm... fixed. I've never even heard of 'git add' before. Why is this\n> different to plain old 'checkout' without the HEAD?\n>\n> Anyway... thanks. Day saved :)\n\nThat ends up being a very long story.  You should probably read about\n\"staging\" files in git in a git tutorial somewhere. :)\n\nGlad I could help.\n\nHave fun,\n\nAvery\n"},{"id":"138662","messageId":"vpq8w91r9bo.fsf@bauges.imag.fr","threadId":"23338","inReplyTo":"p2y26ae428a1004051203jbb7c838eh8de0cb5f6ae1dcb1@mail.gmail.com","subject":"Re: Mysterious junk in file.... \"not commited yet\"","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2010-04-05T19:24:59Z","receivedAt":"2010-04-05T19:24:59Z","isPatch":false,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Howard Miller <howard@e-learndesign.co.uk> writes:\n\n> Hmmm... fixed. I've never even heard of 'git add' before.\n\nHmm, maybe it's time to read the manual, then ;-).\n\n> Why is this different to plain old 'checkout' without the HEAD?\n\nRead about the \"index\" of Git, aka \"staging area\". It's where Git (and\nyou) prepare commit, and \"git diff\" shows you the diff against it.\nPlain \"git checkout\" will read from the index, while \"git checkout\nHEAD\" takes the last commited version.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"138663","messageId":"x2n26ae428a1004051229hf238c770tc4875df83e96a639@mail.gmail.com","threadId":"23338","inReplyTo":"vpq8w91r9bo.fsf@bauges.imag.fr","subject":"Re: Mysterious junk in file.... \"not commited yet\"","fromName":"Howard Miller","fromEmail":"howard@e-learndesign.co.uk","sentAt":"2010-04-05T19:29:29Z","receivedAt":"2010-04-05T19:29:29Z","isPatch":false,"sender":{"key":"howard@e-learndesign.co.uk","avatar":"https://gravatar.com/avatar/ddb66c6a4a077e52b823ac5b04f33ab927cb90e2ab1eafedaeba07b1920bb99e?d=mp&s=160"},"body":"> Plain \"git checkout\" will read from the index, while \"git checkout\n> HEAD\" takes the last commited version.\n\nCool.... that's the bit I hadn't appreciated. I was (falsely) under\nthe impression that 'git checkout' grabbed the last committed version.\nSuitably educated... thanks!\n"}]}