{"thread":{"id":"18425","subject":"How to commit changes if remote repository changed directory structure?","startedAt":"2009-03-20T01:17:15Z","lastAt":"2009-03-20T22:30:05Z","messageCount":5,"participants":["andholt","Jeff King","Junio C Hamano","J. Bruce Fields"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"108638","messageId":"22612715.post@talk.nabble.com","threadId":"18425","inReplyTo":null,"subject":"How to commit changes if remote repository changed directory structure?","fromName":"andholt","fromEmail":"andholt@gmail.com","sentAt":"2009-03-20T01:17:15Z","receivedAt":"2009-03-20T01:17:15Z","isPatch":false,"sender":{"key":"andholt@gmail.com","avatar":null},"body":"\nI have a lot of local changes to add, commit, and push. Right now our\ndirectory structure is 1/2/3. Another developer decided to move everything\nup one level, so used git move to move 3 to 2, and removed 3, so now the\nlevel is 1/2. However, locally, all of my changes are in 1/2/3. \n\nI want to commit my changes and merge them into the new directory structure.\nHow would I go about doing that?\n\nThanks!\n-- \nView this message in context: http://www.nabble.com/How-to-commit-changes-if-remote-repository-changed-directory-structure--tp22612715p22612715.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"108656","messageId":"20090320060926.GC27008@coredump.intra.peff.net","threadId":"18425","inReplyTo":"22612715.post@talk.nabble.com","subject":"Re: How to commit changes if remote repository changed directory structure?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-20T06:09:26Z","receivedAt":"2009-03-20T06:09:26Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Mar 19, 2009 at 06:17:15PM -0700, andholt wrote:\n\n> I have a lot of local changes to add, commit, and push. Right now our\n> directory structure is 1/2/3. Another developer decided to move everything\n> up one level, so used git move to move 3 to 2, and removed 3, so now the\n> level is 1/2. However, locally, all of my changes are in 1/2/3. \n> \n> I want to commit my changes and merge them into the new directory structure.\n> How would I go about doing that?\n\nFirst, commit your changes. Then merge the other developer's changes. :)\n\nThis is exactly the sort of case that git's rename detection should\nhandle; it should detect that the other side renamed files, and then\nconsider your changes against the newly named files. The only thing it\n_won't_ handle is new files that you added in 1/2/3. You will have to\nmanually move them to 1/2 as part of the merge (there has been\ndiscussion of \"detect that this whole directory seems to have had its\ncontent moved and automatically move new files\", but the patches have\nnot been accepted).\n\n-Peff\n"},{"id":"108661","messageId":"7vljr04qnw.fsf@gitster.siamese.dyndns.org","threadId":"18425","inReplyTo":"20090320060926.GC27008@coredump.intra.peff.net","subject":"Re: How to commit changes if remote repository changed directory structure?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-20T07:08:51Z","receivedAt":"2009-03-20T07:08:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Thu, Mar 19, 2009 at 06:17:15PM -0700, andholt wrote:\n>\n>> I have a lot of local changes to add, commit, and push. Right now our\n>> directory structure is 1/2/3. Another developer decided to move everything\n>> up one level, so used git move to move 3 to 2, and removed 3, so now the\n>> level is 1/2. However, locally, all of my changes are in 1/2/3. \n>> \n>> I want to commit my changes and merge them into the new directory structure.\n>> How would I go about doing that?\n>\n> First, commit your changes. Then merge the other developer's changes. :)\n\nWe should probably point out to new people that \"first commit and then\nworry about merges after your changes are safely committed\" is always how\npeople would \"go about\" anything.\n"},{"id":"108663","messageId":"20090320071319.GF27008@coredump.intra.peff.net","threadId":"18425","inReplyTo":"7vljr04qnw.fsf@gitster.siamese.dyndns.org","subject":"Re: How to commit changes if remote repository changed directory structure?","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-20T07:13:19Z","receivedAt":"2009-03-20T07:13:19Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Mar 20, 2009 at 12:08:51AM -0700, Junio C Hamano wrote:\n\n> > First, commit your changes. Then merge the other developer's changes. :)\n> \n> We should probably point out to new people that \"first commit and then\n> worry about merges after your changes are safely committed\" is always how\n> people would \"go about\" anything.\n\nYes, absolutely.\n\nMost of the current documentation focuses on being a reference to\nparticular commands or tasks. But this is more of a \"philosophy of\nworking with git\" item. I guess it should go in the user manual\nsomewhere. Cc'ing Bruce, who may have some comments.\n\n-Peff\n"},{"id":"108768","messageId":"20090320223005.GA25057@fieldses.org","threadId":"18425","inReplyTo":"20090320071319.GF27008@coredump.intra.peff.net","subject":"Re: How to commit changes if remote repository changed directory structure?","fromName":"J. Bruce Fields","fromEmail":"bfields@fieldses.org","sentAt":"2009-03-20T22:30:05Z","receivedAt":"2009-03-20T22:30:05Z","isPatch":false,"sender":{"key":"bfields@citi.umich.edu","avatar":null},"body":"On Fri, Mar 20, 2009 at 03:13:19AM -0400, Jeff King wrote:\n> On Fri, Mar 20, 2009 at 12:08:51AM -0700, Junio C Hamano wrote:\n> \n> > > First, commit your changes. Then merge the other developer's changes. :)\n> > \n> > We should probably point out to new people that \"first commit and then\n> > worry about merges after your changes are safely committed\" is always how\n> > people would \"go about\" anything.\n> \n> Yes, absolutely.\n> \n> Most of the current documentation focuses on being a reference to\n> particular commands or tasks. But this is more of a \"philosophy of\n> working with git\" item. I guess it should go in the user manual\n> somewhere. Cc'ing Bruce, who may have some comments.\n\nI agree, that's kind of an odd hold in the user manual.  Maybe it goes\nwithout saying, but it might be useful somewhere in ch. 3, maybe when\nintroducing commits, something along the lines of: \"note all of these\ncommits are stored only in your local repository, and are visible only\nto you.  With some version control systems, \"committing\" requires\nsending the commit to a central server.  With git, you are expected to\ndo all your work locally and only merge with others' work when\nnecessary; we'll learn how to do that in <chapter 4>.\"\n\nAnd then say something similar again at the start of chapter 4?\n\n--b.\n"}]}