{"thread":{"id":"28972","subject":"Fixing a broken GIT repo","startedAt":"2011-11-18T10:54:14Z","lastAt":"2011-11-21T16:45:10Z","messageCount":5,"participants":["Bart van den Burg","Felipe Contreras","Johannes Sixt","Erik Faye-Lund"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"179688","messageId":"ja5dgo$nlf$1@dough.gmane.org","threadId":"28972","inReplyTo":null,"subject":"Fixing a broken GIT repo","fromName":"Bart van den Burg","fromEmail":"bart@burgov.nl","sentAt":"2011-11-18T10:54:14Z","receivedAt":"2011-11-18T10:54:14Z","isPatch":false,"sender":{"key":"bart@burgov.nl","avatar":null},"body":"Hi\n\nI somehow managed to break my GIT repo. Whenever I try to clone or fetch \nfrom a clean local repo, I get an error.\n\nI'm able to go back on the server, to the very last commit where \neverything works, but as soon as I make a change locally and push it, it \nbreaks again. I've been trying to figure out what's wrong here for about \ntwo days now, but I'm completely lost.\n\nHere's the steps I take to reproduce the problem.\n\nOn the server, I can reset the ref to the last working commit:\n\ngit@server:~/shifter_rai.git$ echo \n\"cc5693a275c25003edc77b59f5a5c603a857f711\" > refs/heads/master\n\nThen, on my local computer, I can clone fine, but after making a commit, \nit breaks again:\n\nbbu@SIT-WST-05 /d/workspace9\n$ git clone git@git.samson-it.nl:/home/git/shifter_rai\nCloning into shifter_rai...\nremote: Counting objects: 9557, done.\nremote: Compressing objects: 100% (1887/1887), done.\nremote: Total 9557 (delta 7107), reused 9397 (delta 7019)\nReceiving objects: 100% (9557/9557), 2.85 MiB | 1.06 MiB/s, done.\nResolving deltas: 100% (7107/7107), done.\n\nbbu@SIT-WST-05 /d/workspace9\n$ cd shifter_rai/\n\nbbu@SIT-WST-05 /d/workspace9/shifter_rai (master)\n$ echo \"test\" > test\n\nbbu@SIT-WST-05 /d/workspace9/shifter_rai (master)\n$ git add test\nwarning: LF will be replaced by CRLF in test.\nThe file will have its original line endings in your working directory.\n\nbbu@SIT-WST-05 /d/workspace9/shifter_rai (master)\n$ git commit\n[master 85d1ee9] test\nwarning: LF will be replaced by CRLF in test.\nThe file will have its original line endings in your working directory.\n  1 files changed, 1 insertions(+), 0 deletions(-)\n  create mode 100644 test\n\nbbu@SIT-WST-05 /d/workspace9/shifter_rai (master)\n$ git push\nCounting objects: 4, done.\nDelta compression using up to 4 threads.\nCompressing objects: 100% (2/2), done.\nWriting objects: 100% (3/3), 271 bytes, done.\nTotal 3 (delta 1), reused 0 (delta 0)\nTo git@git.samson-it.nl:/home/git/shifter_rai\n    cc5693a..85d1ee9  master -> master\n\nbbu@SIT-WST-05 /d/workspace9/shifter_rai (master)\n$ cd ..\n\nbbu@SIT-WST-05 /d/workspace9\n$ rm -rf shifter_rai/\n\nbbu@SIT-WST-05 /d/workspace9\n$ git clone git@git.samson-it.nl:/home/git/shifter_rai\nCloning into shifter_rai...\nremote: Counting objects: 9557, done.\nremote: Compressing objects: 100% (1887/1887), done.\nremote: Total 9557 (delta 7107), reused 9397 (delta 7019)\nReceiving objects: 100% (9557/9557), 2.85 MiB | 1.16 MiB/s, done.\nResolving deltas: 100% (7107/7107), done.\nerror: refs/remotes/origin/master does not point to a valid object!\nerror: Trying to write ref refs/heads/master with nonexistant object \n85d1ee957c65485ed9c937a4f1bfdd44fda4ea35\nfatal: Cannot update the ref 'HEAD'.\n\nNeedless to say, the mentioned object in fact does exist on the server:\ngit@server:~/shifter_rai.git$ ls -la \nobjects/85/d1ee957c65485ed9c937a4f1bfdd44fda4ea35\n-r--r--r-- 1 git git 153 Nov 18 11:39 \nobjects/85/d1ee957c65485ed9c937a4f1bfdd44fda4ea35\n\nCan anyone tell me what is happening here, and how I can fix it?\n"},{"id":"179696","messageId":"CAMP44s2N3WU_vzW9+7cRm+kvKGsoaMbhtuoX6yuNx58EixTkqw@mail.gmail.com","threadId":"28972","inReplyTo":"ja5dgo$nlf$1@dough.gmane.org","subject":"Re: Fixing a broken GIT repo","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2011-11-18T12:54:46Z","receivedAt":"2011-11-18T12:54:46Z","isPatch":false,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Fri, Nov 18, 2011 at 12:54 PM, Bart van den Burg <bart@burgov.nl> wrote:\n> Needless to say, the mentioned object in fact does exist on the server:\n> git@server:~/shifter_rai.git$ ls -la\n> objects/85/d1ee957c65485ed9c937a4f1bfdd44fda4ea35\n> -r--r--r-- 1 git git 153 Nov 18 11:39\n> objects/85/d1ee957c65485ed9c937a4f1bfdd44fda4ea35\n>\n> Can anyone tell me what is happening here, and how I can fix it?\n\nWell, if you can't find that object on the server or your local box,\nthen you would have to find the last commit that worked, and reset the\n'master' branch to that.\n\n-- \nFelipe Contreras\n"},{"id":"179700","messageId":"4EC6625B.2070301@viscovery.net","threadId":"28972","inReplyTo":"ja5dgo$nlf$1@dough.gmane.org","subject":"Re: Fixing a broken GIT repo","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-11-18T13:49:15Z","receivedAt":"2011-11-18T13:49:15Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 11/18/2011 11:54, schrieb Bart van den Burg:\n> I somehow managed to break my GIT repo. Whenever I try to clone or fetch\n> from a clean local repo, I get an error.\n> \n> I'm able to go back on the server, to the very last commit where\n> everything works, but as soon as I make a change locally and push it, it\n> breaks again.\n...\n> $ git clone git@git.samson-it.nl:/home/git/shifter_rai\n...\n> Receiving objects: 100% (9557/9557), 2.85 MiB | 1.06 MiB/s, done.\n...\n> $ git push\n> Counting objects: 4, done.\n> Delta compression using up to 4 threads.\n> Compressing objects: 100% (2/2), done.\n> Writing objects: 100% (3/3), 271 bytes, done.\n> Total 3 (delta 1), reused 0 (delta 0)\n> To git@git.samson-it.nl:/home/git/shifter_rai\n>    cc5693a..85d1ee9  master -> master\n\nIt looks like you are pushing via git protocol from Windows\n(Git-for-Windows). This is known to dead-lock in most cases, and even\nthough it did not here, I would not be surprised if it had other issues.\n\nDo not do it. Push via ssh instead.\n\n> bbu@SIT-WST-05 /d/workspace9\n> $ git clone git@git.samson-it.nl:/home/git/shifter_rai\n> Cloning into shifter_rai...\n> remote: Counting objects: 9557, done.\n> remote: Compressing objects: 100% (1887/1887), done.\n> remote: Total 9557 (delta 7107), reused 9397 (delta 7019)\n> Receiving objects: 100% (9557/9557), 2.85 MiB | 1.16 MiB/s, done.\n> Resolving deltas: 100% (7107/7107), done.\n\nDid you notice that this downloaded the exact same number of objects as\nthe first clone? There should have been at least 9558, but most likely\n9560 objects. There's something fishy.\n\n> error: refs/remotes/origin/master does not point to a valid object!\n> error: Trying to write ref refs/heads/master with nonexistant object\n> 85d1ee957c65485ed9c937a4f1bfdd44fda4ea35\n> fatal: Cannot update the ref 'HEAD'.\n>\n> Needless to say, the mentioned object in fact does exist on the server:\n> git@server:~/shifter_rai.git$ ls -la\n> objects/85/d1ee957c65485ed9c937a4f1bfdd44fda4ea35\n> -r--r--r-- 1 git git 153 Nov 18 11:39\n> objects/85/d1ee957c65485ed9c937a4f1bfdd44fda4ea35\n\nDoes git fsck --full on the server indeed report a good repository? Can\nyou clone this repository to a different client?\n\n-- Hannes\n"},{"id":"179790","messageId":"CABPQNSaJVYqLw+JuOWg2wqa-Sig6+W_W-id7yRFLzZ0kTr73hw@mail.gmail.com","threadId":"28972","inReplyTo":"4EC6625B.2070301@viscovery.net","subject":"Re: Fixing a broken GIT repo","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-11-21T16:37:59Z","receivedAt":"2011-11-21T16:37:59Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Fri, Nov 18, 2011 at 2:49 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n> Am 11/18/2011 11:54, schrieb Bart van den Burg:\n>> I somehow managed to break my GIT repo. Whenever I try to clone or fetch\n>> from a clean local repo, I get an error.\n>>\n>> I'm able to go back on the server, to the very last commit where\n>> everything works, but as soon as I make a change locally and push it, it\n>> breaks again.\n> ...\n>> $ git clone git@git.samson-it.nl:/home/git/shifter_rai\n> ...\n>> Receiving objects: 100% (9557/9557), 2.85 MiB | 1.06 MiB/s, done.\n> ...\n>> $ git push\n>> Counting objects: 4, done.\n>> Delta compression using up to 4 threads.\n>> Compressing objects: 100% (2/2), done.\n>> Writing objects: 100% (3/3), 271 bytes, done.\n>> Total 3 (delta 1), reused 0 (delta 0)\n>> To git@git.samson-it.nl:/home/git/shifter_rai\n>>    cc5693a..85d1ee9  master -> master\n>\n> It looks like you are pushing via git protocol from Windows\n> (Git-for-Windows). This is known to dead-lock in most cases, and even\n> though it did not here, I would not be surprised if it had other issues.\n>\n> Do not do it. Push via ssh instead.\n>\n\nDoes it? Doesn't the \"To git@git.samson-it.nl:/home/git/shifter_rai\"\nline suggests ssh?\n"},{"id":"179791","messageId":"4ECA8016.8070108@viscovery.net","threadId":"28972","inReplyTo":"CABPQNSaJVYqLw+JuOWg2wqa-Sig6+W_W-id7yRFLzZ0kTr73hw@mail.gmail.com","subject":"Re: Fixing a broken GIT repo","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2011-11-21T16:45:10Z","receivedAt":"2011-11-21T16:45:10Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 11/21/2011 17:37, schrieb Erik Faye-Lund:\n> On Fri, Nov 18, 2011 at 2:49 PM, Johannes Sixt <j.sixt@viscovery.net> wrote:\n>> Am 11/18/2011 11:54, schrieb Bart van den Burg:\n>>> To git@git.samson-it.nl:/home/git/shifter_rai\n>>>    cc5693a..85d1ee9  master -> master\n>>\n>> It looks like you are pushing via git protocol from Windows\n>> (Git-for-Windows). This is known to dead-lock in most cases, and even\n>> though it did not here, I would not be surprised if it had other issues.\n>>\n>> Do not do it. Push via ssh instead.\n>>\n> \n> Does it? Doesn't the \"To git@git.samson-it.nl:/home/git/shifter_rai\"\n> line suggests ssh?\n\nOops, you are right.\n\n-- Hannes\n"}]}