{"thread":{"id":"40166","subject":"index file list files not found in working tree","startedAt":"2015-08-24T10:34:43Z","lastAt":"2015-08-25T14:50:08Z","messageCount":4,"participants":["Rafik E Younan","John Keeping"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"268564","messageId":"55DAF343.2050908@gmail.com","threadId":"40166","inReplyTo":null,"subject":"index file list files not found in working tree","fromName":"Rafik E Younan","fromEmail":"rafik.arkdev@gmail.com","sentAt":"2015-08-24T10:34:43Z","receivedAt":"2015-08-24T10:34:43Z","isPatch":false,"sender":{"key":"rafik.arkdev@gmail.com","avatar":null},"body":"Hi,\n\nAfter several merges and rebases I finally got my branches and history \nto reflect valid commits and proper history. Everything is pushed to \ninternal bare repo and the remotes seems OK.\n\nWhen I clone the updated repository, all branches reflect the correct \nupdated trees and blobs.\n\nThe problem occurs only on the original local repository where all the \nmerging and re-basing took place!\n\nWhen I checkout a branch, several files and folders are deleted from the \nworking tree. When I examine the history of these files, there are only \ncommits of adding them and modifying them but no log for deleting them, \nand they aren't deleted when I checkout the same branch in another fresh \ncloned repo.\n\nGit status command doesn't indicate any changes in these files. I found \nthe files and folders names in the `.git/index` file. So after manually \nremoving the `.git/index` file and usinge `git reset` command, `git \nstatus` indicates that the files and folders are deleted.\n\nI use `git checkout -- <File_or_folder_names>...` and restore all \nmissing files and folders, just then the working tree matches the fresh \ncheckout of the same branch on any other cloned repo.\n\nAfter examining the tree object of the current commit, all files and \nfolders exists, although clearly the checkout missed some of them!\n\nBecause the repository is local and private, I can't share any url for \npublicly accessible repository, and if one exists, no problem could be \nfound, because the problem resides in just this certain local clone.\n\nAnswering the following questions might give some clues for the problem:\n* How does git populate the index file after every branch checkout?\n* Is there any object to reflect the content of the index file?\n\nI would appreciate any pointers for where the problem could be.\n\nThanks,\nRafik\n"},{"id":"268633","messageId":"55DC408B.5030804@gmail.com","threadId":"40166","inReplyTo":"55DAF343.2050908@gmail.com","subject":"Re: index file list files not found in working tree","fromName":"Rafik E Younan","fromEmail":"rafik.arkdev@gmail.com","sentAt":"2015-08-25T10:16:43Z","receivedAt":"2015-08-25T10:16:43Z","isPatch":false,"sender":{"key":"rafik.arkdev@gmail.com","avatar":null},"body":"Hi,\n\nI got a recommendation to use reset --hard. I tried it and it says the \nHEAD is now at correct commit, but missing files are not restored!\n\nI tried `ls-tree --name-only` and it lists missing files and folders, \nbut the actual working tree doesn't have these files and folders.\n\nThe question I'd like to answer, how does git generates the `index` file \nbetween checkouts?\n\nThanks,\nRafik\n\nOn 08/24/2015 12:34 PM, Rafik E Younan wrote:\n> Hi,\n>\n> After several merges and rebases I finally got my branches and history \n> to reflect valid commits and proper history. Everything is pushed to \n> internal bare repo and the remotes seems OK.\n>\n> When I clone the updated repository, all branches reflect the correct \n> updated trees and blobs.\n>\n> The problem occurs only on the original local repository where all the \n> merging and re-basing took place!\n>\n> When I checkout a branch, several files and folders are deleted from \n> the working tree. When I examine the history of these files, there are \n> only commits of adding them and modifying them but no log for deleting \n> them, and they aren't deleted when I checkout the same branch in \n> another fresh cloned repo.\n>\n> Git status command doesn't indicate any changes in these files. I \n> found the files and folders names in the `.git/index` file. So after \n> manually removing the `.git/index` file and usinge `git reset` \n> command, `git status` indicates that the files and folders are deleted.\n>\n> I use `git checkout -- <File_or_folder_names>...` and restore all \n> missing files and folders, just then the working tree matches the \n> fresh checkout of the same branch on any other cloned repo.\n>\n> After examining the tree object of the current commit, all files and \n> folders exists, although clearly the checkout missed some of them!\n>\n> Because the repository is local and private, I can't share any url for \n> publicly accessible repository, and if one exists, no problem could be \n> found, because the problem resides in just this certain local clone.\n>\n> Answering the following questions might give some clues for the problem:\n> * How does git populate the index file after every branch checkout?\n> * Is there any object to reflect the content of the index file?\n>\n> I would appreciate any pointers for where the problem could be.\n>\n> Thanks,\n> Rafik\n>\n"},{"id":"268637","messageId":"20150825103214.GH1412@serenity.lan","threadId":"40166","inReplyTo":"55DC408B.5030804@gmail.com","subject":"Re: index file list files not found in working tree","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2015-08-25T10:32:14Z","receivedAt":"2015-08-25T10:32:14Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Tue, Aug 25, 2015 at 12:16:43PM +0200, Rafik E Younan wrote:\n> I got a recommendation to use reset --hard. I tried it and it says the \n> HEAD is now at correct commit, but missing files are not restored!\n> \n> I tried `ls-tree --name-only` and it lists missing files and folders, \n> but the actual working tree doesn't have these files and folders.\n\nIs there any chance that you have enabled sparse checkouts?  See the\ndocumentation at the bottom of git-read-tree(1).\n\n> On 08/24/2015 12:34 PM, Rafik E Younan wrote:\n> > Hi,\n> >\n> > After several merges and rebases I finally got my branches and history \n> > to reflect valid commits and proper history. Everything is pushed to \n> > internal bare repo and the remotes seems OK.\n> >\n> > When I clone the updated repository, all branches reflect the correct \n> > updated trees and blobs.\n> >\n> > The problem occurs only on the original local repository where all the \n> > merging and re-basing took place!\n> >\n> > When I checkout a branch, several files and folders are deleted from \n> > the working tree. When I examine the history of these files, there are \n> > only commits of adding them and modifying them but no log for deleting \n> > them, and they aren't deleted when I checkout the same branch in \n> > another fresh cloned repo.\n> >\n> > Git status command doesn't indicate any changes in these files. I \n> > found the files and folders names in the `.git/index` file. So after \n> > manually removing the `.git/index` file and usinge `git reset` \n> > command, `git status` indicates that the files and folders are deleted.\n> >\n> > I use `git checkout -- <File_or_folder_names>...` and restore all \n> > missing files and folders, just then the working tree matches the \n> > fresh checkout of the same branch on any other cloned repo.\n> >\n> > After examining the tree object of the current commit, all files and \n> > folders exists, although clearly the checkout missed some of them!\n> >\n> > Because the repository is local and private, I can't share any url for \n> > publicly accessible repository, and if one exists, no problem could be \n> > found, because the problem resides in just this certain local clone.\n> >\n> > Answering the following questions might give some clues for the problem:\n> > * How does git populate the index file after every branch checkout?\n> > * Is there any object to reflect the content of the index file?\n> >\n> > I would appreciate any pointers for where the problem could be.\n> >\n> > Thanks,\n> > Rafik\n> >\n> \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":"268649","messageId":"55DC80A0.3060309@gmail.com","threadId":"40166","inReplyTo":"20150825103214.GH1412@serenity.lan","subject":"Re: index file list files not found in working tree","fromName":"Rafik E Younan","fromEmail":"rafik.arkdev@gmail.com","sentAt":"2015-08-25T14:50:08Z","receivedAt":"2015-08-25T14:50:08Z","isPatch":false,"sender":{"key":"rafik.arkdev@gmail.com","avatar":null},"body":"On 08/25/2015 12:32 PM, John Keeping wrote:\n> On Tue, Aug 25, 2015 at 12:16:43PM +0200, Rafik E Younan wrote:\n>> I got a recommendation to use reset --hard. I tried it and it says the\n>> HEAD is now at correct commit, but missing files are not restored!\n>>\n>> I tried `ls-tree --name-only` and it lists missing files and folders,\n>> but the actual working tree doesn't have these files and folders.\n> Is there any chance that you have enabled sparse checkouts?  See the\n> documentation at the bottom of git-read-tree(1).\n>\n>\nThere was `.git/info/sparse-checkout` file in the local repo, but not in \nother cloned repo. I remove the file, the `.git/index` and did reset \n--hard, and all seems works now.\n\nThanks for your help.\n\nGit community rocks!\n\nRegards,\nRafik\n"}]}