{"thread":{"id":"29449","subject":"How to reorganize git tree","startedAt":"2012-01-26T18:35:05Z","lastAt":"2012-01-26T23:27:32Z","messageCount":3,"participants":["Alan Edwards","Ben Walton","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"183127","messageId":"20120126133505.it34vehs0044o848@webmail.xnet.com","threadId":"29449","inReplyTo":null,"subject":"How to reorganize git tree","fromName":"Alan Edwards","fromEmail":"kae@xnet.com","sentAt":"2012-01-26T18:35:05Z","receivedAt":"2012-01-26T18:35:05Z","isPatch":false,"sender":{"key":"kae@xnet.com","avatar":null},"body":"I was new to git about a year ago and created a git directory  \nstructure containing several different projects like:\n\n/source/web_server1/project1\n/source/web_server1/project2\n/source/web_server1/project3\n/source/web_server1/project4\n/source/web_server2/project5\n/source/web_server2/project6\n\nwhere my massive .git repository is:\n\n/source/.git (containing all the projects on all the web servers....  \nOops!) There seems to be lots of \"loose objects\".\n\nSomewhere along the way I figured out that this probably wasn't a good  \nidea and I ended up making a git repository under one of the projects:\n\n/source/web_server1/project4/.git\n\nNot sure if that was the best decision either. I've already checked in  \nchanges to the /source/web_server1/project4/.git repository for  \nproject4 and I've checked in changes to project2 into the /source/.git  \nrepository.\n\nOf course I now realize the errors of my way and would like to restructure.\n\nthe only changes that have been checked into the big upper level  \nrepository are changes for project2.  Is it possible to carve out  \nthose changes from the /source/.git repository and create a new  \n/source/web_server1/project2/.git repository?\n\nMaybe the way to deal with this is to remove the other directories  \nfrom the /source/.git repository and leave project2 there.\n\nAny one have any suggestions?\n\nI'm not sure if I'm posting this in the right place (I'm at work and  \nthey don't allow access to many places and I don't have access to the  \nnews group).\n\nThanks!\n\n-Alan Edwards\n  kae at xnet dot com (my home email address)\n"},{"id":"183128","messageId":"1327604128-sup-1697@pinkfloyd.chass.utoronto.ca","threadId":"29449","inReplyTo":"20120126133505.it34vehs0044o848@webmail.xnet.com","subject":"Re: How to reorganize git tree","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2012-01-26T18:57:16Z","receivedAt":"2012-01-26T18:57:16Z","isPatch":false,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Excerpts from Alan Edwards's message of Thu Jan 26 13:35:05 -0500 2012:\n\nHi Alan,\n\n> Any one have any suggestions?\n\nI think that git filter-branch is going to be your friend here.  I\nwon't prescribe the details as you should definitely read and\nunderstand the docs for this one, but things like\n--subdirectory-filter and/or --tree-filter will be of great use to\nyou, I think.\n\nHope this helps.\n\nThanks\n-Ben\n--\nBen Walton\nSystems Programmer - CHASS\nUniversity of Toronto\nC:416.407.5610 | W:416.978.4302\n"},{"id":"183142","messageId":"m3ehumdoxs.fsf@localhost.localdomain","threadId":"29449","inReplyTo":"1327604128-sup-1697@pinkfloyd.chass.utoronto.ca","subject":"Re: How to reorganize git tree","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2012-01-26T23:27:32Z","receivedAt":"2012-01-26T23:27:32Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Ben Walton <bwalton@artsci.utoronto.ca> writes:\n\n> Excerpts from Alan Edwards's message of Thu Jan 26 13:35:05 -0500 2012:\n> \n> Hi Alan,\n> \n> > Any one have any suggestions?\n> \n> I think that git filter-branch is going to be your friend here.  I\n> won't prescribe the details as you should definitely read and\n> understand the docs for this one, but things like\n> --subdirectory-filter and/or --tree-filter will be of great use to\n> you, I think.\n\nThird-party git-subtree tool can also help here, I think.\n\n-- \nJakub Narebski\n"}]}