{"thread":{"id":"6235","subject":"fatal: unable to create '.git/index': File exists","startedAt":"2007-01-05T16:50:09Z","lastAt":"2007-01-06T09:24:24Z","messageCount":5,"participants":["Len Brown","Manu","Johannes Schindelin","Fredrik Kuivinen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"30888","messageId":"200701051150.09968.lenb@kernel.org","threadId":"6235","inReplyTo":null,"subject":"fatal: unable to create '.git/index': File exists","fromName":"Len Brown","fromEmail":"lenb@kernel.org","sentAt":"2007-01-05T16:50:09Z","receivedAt":"2007-01-05T16:50:09Z","isPatch":false,"sender":{"key":"lenb@kernel.org","avatar":null},"body":"I kicked off a pull.\nRealized I was on the wrong branch\nand immediately did a ^C\n\nNow I can't change branches:\n\n# git checkout release\nfatal: unable to create '.git/index': File exists\nfatal: unable to create '.git/index': File exists\n\ngit reset --hard\ndoes not help.\n\ncuriously, moving .git/index to /tmp and repeating\nresults in the same error.\n\nclues?\n\nthanks,\n-Len\n"},{"id":"30892","messageId":"f898cca90701050930l21338b88t1bd75e037beeca05@mail.gmail.com","threadId":"6235","inReplyTo":"200701051150.09968.lenb@kernel.org","subject":"Re: fatal: unable to create '.git/index': File exists","fromName":"Manu","fromEmail":"manu@blairos.org","sentAt":"2007-01-05T17:30:00Z","receivedAt":"2007-01-05T17:30:00Z","isPatch":false,"sender":{"key":"manu@blairos.org","avatar":null},"body":"Got this message once.\nThe reason was a git process still had a lock on the index file.\nMake sure you have no git processes left running from the interruption\nof git pull.\n\nps -ux | grep \"git\"\n\nManu\n\nOn 1/5/07, Len Brown <lenb@kernel.org> wrote:\n> I kicked off a pull.\n> Realized I was on the wrong branch\n> and immediately did a ^C\n>\n> Now I can't change branches:\n>\n> # git checkout release\n> fatal: unable to create '.git/index': File exists\n> fatal: unable to create '.git/index': File exists\n>\n> git reset --hard\n> does not help.\n>\n> curiously, moving .git/index to /tmp and repeating\n> results in the same error.\n>\n> clues?\n>\n> thanks,\n> -Len\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>\n"},{"id":"30900","messageId":"Pine.LNX.4.63.0701052115161.22628@wbgn013.biozentrum.uni-wuerzburg.de","threadId":"6235","inReplyTo":"200701051150.09968.lenb@kernel.org","subject":"Re: fatal: unable to create '.git/index': File exists","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-01-05T20:16:18Z","receivedAt":"2007-01-05T20:16:18Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 5 Jan 2007, Len Brown wrote:\n\n> I kicked off a pull.\n> Realized I was on the wrong branch\n> and immediately did a ^C\n> \n> Now I can't change branches:\n> \n> # git checkout release\n> fatal: unable to create '.git/index': File exists\n\nThis usually means that .git/index.lock exists. Try removing that file.\n\nHowever, it _should_ be removed by the atexit() handler, methinks. I have \nno idea why it does not.\n\nCiao,\nDscho\n"},{"id":"30954","messageId":"200701052201.39727.lenb@kernel.org","threadId":"6235","inReplyTo":"200701051150.09968.lenb@kernel.org","subject":"Re: fatal: unable to create '.git/index': File exists","fromName":"Len Brown","fromEmail":"lenb@kernel.org","sentAt":"2007-01-06T03:01:39Z","receivedAt":"2007-01-06T03:01:39Z","isPatch":false,"sender":{"key":"lenb@kernel.org","avatar":null},"body":"On Friday 05 January 2007 11:50, Len Brown wrote:\n> I kicked off a pull.\n> Realized I was on the wrong branch\n> and immediately did a ^C\n> \n> Now I can't change branches:\n> \n> # git checkout release\n> fatal: unable to create '.git/index': File exists\n> fatal: unable to create '.git/index': File exists\n> \n> git reset --hard\n> does not help.\n> \n> curiously, moving .git/index to /tmp and repeating\n> results in the same error.\n\nrm .git/index.lock\nseemed to do the trick.\nHopefully nothing is toasted by this...\n"},{"id":"30959","messageId":"4c8ef70701060124u3fa1dddfp5347a006c4ebb13d@mail.gmail.com","threadId":"6235","inReplyTo":"Pine.LNX.4.63.0701052115161.22628@wbgn013.biozentrum.uni-wuerzburg.de","subject":"Re: fatal: unable to create '.git/index': File exists","fromName":"Fredrik Kuivinen","fromEmail":"frekui@gmail.com","sentAt":"2007-01-06T09:24:24Z","receivedAt":"2007-01-06T09:24:24Z","isPatch":false,"sender":{"key":"frekui@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13770967?v=4"},"body":"On 1/5/07, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:\n> Hi,\n>\n> On Fri, 5 Jan 2007, Len Brown wrote:\n>\n> > I kicked off a pull.\n> > Realized I was on the wrong branch\n> > and immediately did a ^C\n> >\n> > Now I can't change branches:\n> >\n> > # git checkout release\n> > fatal: unable to create '.git/index': File exists\n>\n> This usually means that .git/index.lock exists. Try removing that file.\n>\n> However, it _should_ be removed by the atexit() handler, methinks. I have\n> no idea why it does not.\n\nWe will get SIGINT when the user hits ^C so I don't think the atexit handler\nwill run. However, we also install a signal handler for SIGINT which removes\nthe lock file, so I don't really see how it can be left around...\n\nThere is a small race condition between open and signal as we do\n\n    fd = open(lk->filename, O_RDWR | O_CREAT | O_EXCL, 0666);\n    ...\n    signal(SIGINT, remove_lock_file_on_signal);\n    atexit(remove_lock_file);\n\nin lock_file:lockfile.c. But I think it is very improbable that the user hits ^C\nbetween  \"open\" and \"signal\". It might be worth fixing though.\n\nAre there any other signals we might get when the user hits ^C? SIGPIPE?\n\n- Fredrik\n"}]}